~xdavidwu/himitsu-docker

10d6f9e643d89748babd86a602954f30e16d3f95 — xdavidwu 2 years ago ba40364
close himitsu socket when done
M cmd/docker-credential-himitsu/erase.ha => cmd/docker-credential-himitsu/erase.ha +2 -0
@@ 1,11 1,13 @@
use bufio;
use himitsu::client;
use himitsu::query;
use net;
use os;
use strings;

fn erase() void = {
	const hi = client::connect()!;
	defer net::close(hi)!;
	const url = strings::fromutf8(bufio::scanline(os::stdin)! as []u8);
	const query = query::query {
		items = [

M cmd/docker-credential-himitsu/get.ha => cmd/docker-credential-himitsu/get.ha +2 -1
@@ 1,14 1,15 @@
use bufio;
use encoding::json;
use fmt;
use himitsu::client;
use himitsu::query;
use net;
use os;
use shlex;
use strings;

fn get() void = {
	const hi = client::connect()!;
	defer net::close(hi)!;
	const url = strings::fromutf8(bufio::scanline(os::stdin)! as []u8);
	const query = query::query {
		items = [

M cmd/docker-credential-himitsu/list.ha => cmd/docker-credential-himitsu/list.ha +2 -0
@@ 1,12 1,14 @@
use encoding::json;
use himitsu::client;
use himitsu::query;
use net;
use os;
use shlex;
use strings;

fn list() void = {
	const hi = client::connect()!;
	defer net::close(hi)!;
	const query = query::query {
		items = [
			query::pair { key = "proto", value = "docker", private = false, optional = false},

M cmd/docker-credential-himitsu/store.ha => cmd/docker-credential-himitsu/store.ha +2 -0
@@ 1,10 1,12 @@
use encoding::json;
use himitsu::client;
use himitsu::query;
use net;
use os;

fn store() void = {
	const hi = client::connect()!;
	defer net::close(hi)!;
	const json = json::load(os::stdin)! as json::object;
	defer json::finish(json);
	const url = *(json::get(&json, "ServerURL") as *json::value) as str;