Documentation
¶
Index ¶
- Constants
- Variables
- func GetGeneralStatusError(code int, module int) (res string)
- func ParseStruct2Json(opts interface{}) (string, error)
- func ParseStruct2MultiMap(opts interface{}) map[string][]string
- func ParseStruct2QueryString(opts interface{}) string
- type APIError
- type DClient
- func (client *DClient) Do(module ModuleAPI, param interface{}, urlParam string) (str_result []byte, err error)
- func (client *DClient) InspectImage(name string, image *InspectImageAPI_Resp) (err error)
- func (client *DClient) ListImages(param ListImagesAPI_Query, images *[]ListImagesAPI_Resp) (err error)
- func (c *DClient) Ping() (bool, error)
- type InspectImageAPI_Resp
- type ListImagesAPI_Query
- type ListImagesAPI_Resp
- type ModuleAPI
Constants ¶
View Source
const ( DefaultDockerAPIVersion = "1.13" DefaultTimeoutSeconds = 60 StreamHeaderSizeBytes = 8 )
View Source
const ( Images = 1 Containers = 2 Misc = 3 )
modules
Variables ¶
View Source
var InsertFileAPI = ModuleAPI{ Module: Images, Version: []string{"1.11", "1.12"}, ReqUrl: "/images/%s/insert", ResType: "application/json", ReqType: "", Method: "post", }
View Source
var InspectImageAPI = ModuleAPI{ Module: Images, Version: []string{"1.11", "1.12", "1.13"}, ReqUrl: "/images/%s/json", ResType: "application/json", ReqType: "", Method: "get", }
View Source
var ListImagesAPI = ModuleAPI{ Module: Images, Version: []string{"1.11", "1.12", "1.13"}, ReqUrl: "/images/json", ResType: "application/json", ReqType: "", Method: "get", }
Functions ¶
func GetGeneralStatusError ¶
func ParseStruct2MultiMap ¶
Struct to Multi-value Map
func ParseStruct2QueryString ¶
func ParseStruct2QueryString(opts interface{}) string
Struct to query string
Types ¶
type DClient ¶
type DClient struct {
// contains filtered or unexported fields
}
func NewDClient ¶
create a new DClient with the given endpoint and version, with additional timeout param
func (*DClient) Do ¶
func (client *DClient) Do(module ModuleAPI, param interface{}, urlParam string) (str_result []byte, err error)
param for ?param urlParam for /path/%s/..../ I checkout the docker's doc, I found url only require one param, so I make this args... silly but useful : )
func (*DClient) InspectImage ¶
func (client *DClient) InspectImage(name string, image *InspectImageAPI_Resp) (err error)
func (*DClient) ListImages ¶
func (client *DClient) ListImages(param ListImagesAPI_Query, images *[]ListImagesAPI_Resp) (err error)
type InspectImageAPI_Resp ¶
type InspectImageAPI_Resp struct {
Created string
Container string
ContainerConfig struct {
Hostname string
User string
Memory int
MemorySwap int
AttachStdin bool
AttachStdout bool
AttachStderr bool
PortSpecs string
Tty bool
OpenStdin bool
StdinOnce bool
Env []string
Cmd []string
Dns []string
Image string
Volumes []string
VolumesFrom string
WorkingDir string
}
Id string
Parent string
Size int
}
type ListImagesAPI_Query ¶
type ListImagesAPI_Resp ¶
type ModuleAPI ¶
type ModuleAPI struct {
Module int // container | images | misc
Version []string // supported version ["1.11","1.12"]
ReqUrl string // path for API /images/%s/insert
ResType string // application/json or application/vnd.docker.raw-stream or application/octet-stream or nothing
ReqType string // application/json or nothing
Method string //get post delete
}
Click to show internal directories.
Click to hide internal directories.