docker

package
v0.0.0-...-6113c70 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRepository = "docker.io/library"

Variables

This section is empty.

Functions

func GetSize

func GetSize(byt int64) string

Types

type ContainerInfo

type ContainerInfo struct {
	ID         string      `json:"id"`
	Names      []string    `json:"names"`
	Image      string      `json:"image"`
	ImageID    string      `json:"image_id"`
	Command    string      `json:"command"`
	SizeRw     string      `json:"size_rw,omitempty"`
	SizeRootFs string      `json:"size_rootfs,omitempty"`
	Created    string      `json:"created"`
	State      string      `json:"state"`
	Status     string      `json:"status"`
	Ports      []PortInfo  `json:"ports"`
	Mounts     []MountInfo `json:"mounts"`
}

type DClient

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

func NewClient

func NewClient(host string, port int, version string) (*DClient, error)

func (*DClient) CreateContainer

func (d *DClient) CreateContainer(repository, imageName, version string, volument []string, ports map[int][]int, cname string) (id string, err error)

func (*DClient) GetAllContainer

func (d *DClient) GetAllContainer() ([]ContainerInfo, error)

func (*DClient) GetAllImageList

func (d *DClient) GetAllImageList() ([]ImageInfo, error)

func (*DClient) ImageIsExists

func (d *DClient) ImageIsExists(image, version string) (bool, error)

func (*DClient) PullImage

func (d *DClient) PullImage(repository, imageName, version string) (isDownload bool, err error)

func (*DClient) StartContainer

func (d *DClient) StartContainer(id string) error

type ImageInfo

type ImageInfo struct {
	Repository string `json:"repository"`
	Tag        string `json:"tag"`
	ImageID    string `json:"image_id"`
	Created    string `json:"created"`
	Size       string `json:"size"`
}

type MountInfo

type MountInfo struct {
	Type        string `json:"type,omitempty"`
	Name        string `json:"name,omitempty"`
	Source      string `json:"source"`
	Destination string `json:"destination"`
	Driver      string `json:"driver,omitempty"`
	Mode        string `json:"mode"`
	RW          bool   `json:"rw"`
	Propagation string `json:"propagation"`
}

type PortInfo

type PortInfo struct {
	IP          string `json:"ip,omitempty"`
	PrivatePort uint16 `json:"private_port"`
	PublicPort  uint16 `json:"public_port,omitempty"`
	Type        string `json:"type"`
}

Jump to

Keyboard shortcuts

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