docker_api

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FilterDangling
	// +desc
	// image that without label
	// +usage
	// dangling=true|false
	FilterDangling = "dangling"

	// FilterLabel
	// +usage
	// label=com.example.version=1.0
	FilterLabel = "label"

	// FilterBefore
	// +usage
	// before=IMAGE_ID|IMAGE_NAME
	FilterBefore = "before"

	// FilterSince
	// +usage
	// before=IMAGE_ID|IMAGE_NAME
	FilterSince = "since"

	// FilterReference
	// reference=IMAGE_NAME:IMAGE_TAG
	FilterReference = "reference"
)

filter args in image +referred from: https://docs.docker.com/reference/cli/docker/image/ls/#filter cli: docker image --filter "foo=bar" --filter "bif=baz"

View Source
const (
	FilterID   = "id"
	FilterName = "name"

	// FilterExited
	// +usage
	// exited=created|restarting|running|removing|paused|exited|dead
	FilterExited   = "exited"
	FilterStatus   = "status"
	FilterAncestor = "ancestor"

	FilterVolume  = "volume"
	FilterNetwork = "network"

	// FilterPublish
	// FilterExpose
	// +usage
	// publish=PORT/[PROTO] | STARTPORT-ENDPORT/[PROTO]
	FilterPublish = "publish"
	FilterExpose  = "expose"

	// FilterHealth
	// +usage
	// health=starting|healthy|unhealthy|none
	FilterHealth = "health"

	// FilterIsolation
	// +usage
	// isolation=default|process|hyperv
	FilterIsolation = "isolation"

	// FilterIsTask
	// +usage
	// is-task=true|false
	FilterIsTask = "is-task"
)

filter args in container +referred from: https://docs.docker.com/reference/cli/docker/container/ls/#filter cli: docker ps --filter "foo=bar" --filter "bif=baz"

View Source
const (
	// referred from: "github.com/docker/docker/client/image_list_test.go/TestImageListConnectionError
	ReferenceNone = "no-such-image.invalid:no-such-tag.invalid"
	ReferenceAll  = "*"
)

filter constant +self define

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(hostURL, version string) (*Client, error)

func (*Client) CreateImageTag added in v1.1.3

func (c *Client) CreateImageTag(toAbsRefStr, fromAsbRefStr string) (io.ReadCloser, error)

func (*Client) ExportImage added in v1.1.3

func (c *Client) ExportImage(absRefStr string) (io.ReadCloser, error)

ExportImage +param absRefStr 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) HostImageGC added in v1.1.3

func (c *Client) HostImageGC(hostImageGCFunc 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) ImportImage added in v1.1.3

func (c *Client) ImportImage(absRefStr string, input io.Reader) (io.ReadCloser, error)

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) ListContainerFullIds

func (c *Client) ListContainerFullIds() ([]string, error)

func (*Client) ListContainerIds

func (c *Client) ListContainerIds() ([]string, error)

func (*Client) ListContainerNames

func (c *Client) ListContainerNames() ([]string, error)

func (*Client) ListContainers

func (c *Client) ListContainers() ([]types.Container, error)

func (*Client) WithContext

func (c *Client) WithContext(ctx context.Context) *Client

func (*Client) WithPage

func (c *Client) WithPage(page *util.Page) *Client

type HostImageGCFunc added in v1.1.3

type HostImageGCFunc func()

type ImageRef added in v1.1.3

type ImageRef struct {
	Registry   string
	Project    string
	Repository string
	Tag        string
	// contains filtered or unexported fields
}

func ParseImageRef added in v1.1.3

func ParseImageRef(absRefStr string) (imageRef ImageRef)

func (*ImageRef) String added in v1.1.3

func (r *ImageRef) String() string

Directories

Path Synopsis
Package docker_inst/client.go was generated by codegen, do not modify it
Package docker_inst/client.go was generated by codegen, do not modify it

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL