Documentation ¶
Overview ¶
Package docker_api
Index ¶
- type Client
- func (c *Client) CreateImageTag(toAbsRefStr, fromAbsRefStr string) (io.ReadCloser, error)
- func (c *Client) CreateImageTagV2(toAbsRefStr, fromAbsRefStr string) (resp PushImageOfficialAPIResp, err error)
- func (c *Client) Do(cfn ...ClientFunc) error
- func (c *Client) ExportContainer(containerID string) (io.ReadCloser, error)
- func (c *Client) ExportImage(absRefStr string) (resp ExportImageResp, err error)
- func (c *Client) GC(gcFn ...util.Func)
- func (c *Client) HostImageStorageGC(gcFunc ...HostImageGCFunc)
- func (c *Client) ImportContainer(destRefStr string) (io.ReadCloser, error)
- func (c *Client) ImportImage(absRefStr string, input io.Reader) (resp ImportImageResp, err error)
- func (c *Client) ImportImageV2(absRefStr string, input io.Reader) (resp ImportImageResp, err error)
- func (c *Client) InspectImage(imageID string) (types.ImageInspect, error)
- func (c *Client) ListContainerFullIds() ([]string, error)
- func (c *Client) ListContainerIds() ([]string, error)
- func (c *Client) ListContainerNames() ([]string, error)
- func (c *Client) ListContainers() ([]types.Container, error)
- func (c *Client) RegistryAuth(config *registry.AuthConfig) (string, error)
- func (c *Client) WithContext(ctx context.Context) *Client
- func (c *Client) WithPage(page *util.Page) *Client
- func (c *Client) WithRegistryAuth(registryAuthConfig *registry.AuthConfig) *Client
- type ClientFunc
- type ExportImageResp
- type HostImageGCFunc
- type ImportImageResp
- type PushImageOfficialAPIResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateImageTag ¶ added in v1.1.3
func (c *Client) CreateImageTag(toAbsRefStr, fromAbsRefStr string) (io.ReadCloser, error)
func (*Client) CreateImageTagV2 ¶ added in v1.2.31
func (c *Client) CreateImageTagV2(toAbsRefStr, fromAbsRefStr string) (resp PushImageOfficialAPIResp, err error)
func (*Client) Do ¶ added in v1.2.30
func (c *Client) Do(cfn ...ClientFunc) error
func (*Client) ExportContainer ¶ added in v1.1.4
func (c *Client) ExportContainer(containerID string) (io.ReadCloser, error)
func (*Client) ExportImage ¶ added in v1.1.3
func (c *Client) ExportImage(absRefStr string) (resp ExportImageResp, err error)
ExportImage +param absRefStr (1). absolutely reference string for registry/project/repository/artifact/name:tag +desc
(1).if image do not exist in docker host local, pull image to local (2).get image id by absRefStr (3).save image to docker host local get io.ReadCloser fd
func (*Client) HostImageStorageGC ¶ added in v1.1.4
func (c *Client) HostImageStorageGC(gcFunc ...HostImageGCFunc)
HostImageGC cli: docker rmi IMAGE_ID maybe quota by:
1. image CREATED: since, before 2. image SIZE: bytes(B) 3. cache algorithm policy: lru, lfu 4. host disk: bytes(B)
func (*Client) ImportContainer ¶ added in v1.1.4
func (c *Client) ImportContainer(destRefStr string) (io.ReadCloser, error)
func (*Client) ImportImage ¶ added in v1.1.3
ImportImage +param input
(1). make sure the input file(.tar.gz) metadata attribute image name format is: registry/project/image_name:image_tag
(1.1). or will create new image tag to local
(2). push image to registry
func (*Client) ImportImageV2 ¶ added in v1.2.31
func (*Client) InspectImage ¶ added in v1.1.4
func (c *Client) InspectImage(imageID string) (types.ImageInspect, error)
InspectImage +param imageID or imageName
func (*Client) ListContainerFullIds ¶
func (*Client) ListContainerIds ¶
func (*Client) ListContainerNames ¶
func (*Client) RegistryAuth ¶ added in v1.1.4
func (c *Client) RegistryAuth(config *registry.AuthConfig) (string, error)
func (*Client) WithRegistryAuth ¶ added in v1.1.4
func (c *Client) WithRegistryAuth(registryAuthConfig *registry.AuthConfig) *Client
type ClientFunc ¶ added in v1.2.30
type ExportImageResp ¶ added in v1.2.31
type ExportImageResp struct { RequestRefStr string NotFoundInRegistry bool // absRefStr not found in provided registry. NotFoundInLocal bool // absRefStr not found in docker-server local. ImagePulledInfo string // image pulled information from provided registry. ImageFileReader io.ReadCloser // compressed (.tar, .tar.gz) file reader, It's up to the caller to handle the io.ReadCloser and close it properly. }
type HostImageGCFunc ¶ added in v1.1.3
type ImportImageResp ¶ added in v1.2.31
type PushImageOfficialAPIResp ¶ added in v1.2.31
type PushImageOfficialAPIResp struct { Messages []*jsonmessage.JSONMessage Aux []*map[string]any //jsonmessage.JSONMessage .Aux -> []byte -> map[string]any }
{"status":"The push refers to repository [10.112.121.243:8111/library/hello]"} {"status":"Preparing","progressDetail":{},"id":"ac28800ec8bb"} {"status":"Layer already exists","progressDetail":{},"id":"ac28800ec8bb"} {"status":"v3.0: digest: sha256:d37ada95d47ad12224c205a938129df7a3e52345828b4fa27b03a98825d1e2e7 size: 524"} {"progressDetail":{},"aux":{"Tag":"v3.0","Digest":"sha256:d37ada95d47ad12224c205a938129df7a3e52345828b4fa27b03a98825d1e2e7","Size":524}}
func (*PushImageOfficialAPIResp) GetDigest ¶ added in v1.2.31
func (r *PushImageOfficialAPIResp) GetDigest() string
func (*PushImageOfficialAPIResp) GetSize ¶ added in v1.2.31
func (r *PushImageOfficialAPIResp) GetSize() string
func (*PushImageOfficialAPIResp) Parse ¶ added in v1.2.31
func (r *PushImageOfficialAPIResp) Parse(jsonStrSplitByLineFeed string)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package docker_inst/client.go was generated by codegen, please fix its package dependency, but do not modify its functionality
|
Package docker_inst/client.go was generated by codegen, please fix its package dependency, but do not modify its functionality |