コード例 #1
0
ファイル: main.go プロジェクト: joshie/lochness
func fetch(cmd *cobra.Command, specs []string) {
	c := cli.NewClient(getServerURL())
	if len(specs) == 0 {
		specs = cli.Read(os.Stdin)
	}
	for _, spec := range specs {
		cli.AssertSpec(spec)
		image, _ := c.Post("image", "images", spec)
		cli.JMap(image).Print(jsonout)
	}
}
コード例 #2
0
ファイル: main.go プロジェクト: joshie/lochness
func del(cmd *cobra.Command, ids []string) {
	c := cli.NewClient(getServerURL())
	if len(ids) == 0 {
		ids = cli.Read(os.Stdin)
	}

	for _, id := range ids {
		cli.AssertID(id)
		image, _ := c.Delete("image", "images/"+id)
		cli.JMap(image).Print(jsonout)
	}
}