api

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2016 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DOCKERFILE   = "Dockerfile"
	DOCKERIGNORE = ".dockerignore"
)
View Source
const (
	STREAM_HEADER_LENGTH = 8
	STREAM_TYPE_INDEX    = 0
	STREAM_SIZE_INDEX    = 4

	STREAM_TYPE_STDIN  = 0
	STREAM_TYPE_STDOUT = 1
	STREAM_TYPE_STDERR = 2
)
View Source
const (
	CHANGE_TYPE_MODIFY = iota
	CHANGE_TYPE_ADD
	CHANGE_TYPE_DELETE
)
View Source
const (
	API_VERSION = "1.16"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	Username      string `json:"username"`
	Password      string `json:"password"`
	Email         string `json:"email"`
	ServerAddress string `json:"serveraddress"`
	Auth          string `json:"auth"`
}

func (*AuthConfig) Encode

func (authConfig *AuthConfig) Encode() string

type Config

type Config struct {
	Hostname        string
	Domainname      string
	User            string
	Memory          int64
	MemorySwap      int64
	CpuShares       int64
	Cpuset          string
	AttachStderr    bool
	AttachStdin     bool
	AttachStdout    bool
	PortSpecs       []string
	ExposedPorts    map[string]struct{}
	Tty             bool
	OpenStdin       bool
	StdinOnce       bool
	Env             []string
	Cmd             []string
	Image           string
	Volumes         map[string]struct{}
	WorkingDir      string
	Entrypoint      []string
	NetworkDisabled bool
	MacAddress      string
	OnBuild         []string
}

https://github.com/docker/docker/blob/master/runconfig%2Fconfig.go#L11

type Container

type Container struct {
	Id         string
	Names      []string
	Image      string
	Command    string
	Created    int64
	Status     string
	Ports      []Port
	SizeRw     int64
	SizeRootFs int64
}

https://github.com/docker/docker/blob/master/daemon%2Flist.go#L123

type ContainerInfo

type ContainerInfo struct {
	Id              string
	Created         time.Time
	Path            string
	Args            []string
	Config          Config
	State           State
	Image           string
	NetworkSettings NetworkSettings
	ResolvConfPath  string
	HostnamePath    string
	HostsPath       string
	Name            string
	RestartCount    int
	Driver          string
	ExecDriver      string
	MountLabel      string
	ProcessLabel    string
	Volumes         map[string]string
	VolumesRW       map[string]bool
	AppArmorProfile string
	ExecIDs         []string
	HostConfig      HostConfig
}

https://github.com/docker/docker/blob/master/daemon%2Finspect.go#L31 https://github.com/docker/docker/blob/master/daemon%2Fcontainer.go#L53

type DeviceMapping

type DeviceMapping struct {
	PathOnHost        string
	PathInContainer   string
	CgroupPermissions string
}

https://github.com/docker/docker/blob/master/runconfig%2Fhostconfig.go#L90

type DockerClient

type DockerClient struct {
	URL        *url.URL
	HTTPClient *http.Client
	TLSConfig  *tls.Config
	// contains filtered or unexported fields
}

func NewDockerClient

func NewDockerClient(daemonUrl string, tlsConfig *tls.Config, timeout time.Duration, out io.Writer) (*DockerClient, error)

func (*DockerClient) Auth

func (client *DockerClient) Auth(auth *AuthConfig) (string, error)

func (*DockerClient) BuildImage

func (client *DockerClient) BuildImage(path, tag string, quiet bool) (string, error)

func (*DockerClient) CommitContainer

func (client *DockerClient) CommitContainer(name, repo, tag, comment, author string, pause bool) (string, error)

func (*DockerClient) CopyContainer

func (client *DockerClient) CopyContainer(name, path string) error

func (*DockerClient) CreateContainer

func (client *DockerClient) CreateContainer(name string, config Config, hostConfig HostConfig) (string, error)

func (*DockerClient) ExportContainer

func (client *DockerClient) ExportContainer(name string) error

func (*DockerClient) GetContainerChanges

func (client *DockerClient) GetContainerChanges(name string) ([]Change, error)

func (*DockerClient) GetContainerLogs

func (client *DockerClient) GetContainerLogs(name string, follow, stdout, stderr, timestamps bool, tail int) ([]string, error)

func (*DockerClient) GetContainerProcesses

func (client *DockerClient) GetContainerProcesses(name, ps_args string) (*Processes, error)

func (*DockerClient) GetImageHistory

func (client *DockerClient) GetImageHistory(name string) (ImageHistories, error)

func (*DockerClient) Info

func (client *DockerClient) Info() (*Info, error)

func (*DockerClient) InspectContainer

func (client *DockerClient) InspectContainer(name string) (*ContainerInfo, error)

func (*DockerClient) InspectImage

func (client *DockerClient) InspectImage(name string) (*ImageInfo, error)

func (*DockerClient) KillContainer

func (client *DockerClient) KillContainer(name, signal string) error

func (*DockerClient) ListContainers

func (client *DockerClient) ListContainers(all, size bool, limit int, since, before string, filters map[string][]string) ([]Container, error)

func (*DockerClient) ListImages

func (client *DockerClient) ListImages(all bool, filters map[string][]string) ([]Image, error)

func (*DockerClient) PauseContainer

func (client *DockerClient) PauseContainer(name string) error

func (*DockerClient) PullImage

func (client *DockerClient) PullImage(name string) (string, error)

func (*DockerClient) PushImage

func (client *DockerClient) PushImage(name, tag, credentials string) (string, error)

func (*DockerClient) RemoveContainer

func (client *DockerClient) RemoveContainer(name string, force bool) error

func (*DockerClient) RemoveImage

func (client *DockerClient) RemoveImage(name string, force, noprune bool) error

func (*DockerClient) RestartContainer

func (client *DockerClient) RestartContainer(name string, timeToWait int) error

func (*DockerClient) SearchImages

func (client *DockerClient) SearchImages(term string) (ImageSearchResults, error)

func (*DockerClient) StartContainer

func (client *DockerClient) StartContainer(name string) error

func (*DockerClient) StopContainer

func (client *DockerClient) StopContainer(name string, timeToWait int) error

func (*DockerClient) TagImage

func (client *DockerClient) TagImage(name, repo, tag string, force bool) error

func (*DockerClient) UnpauseContainer

func (client *DockerClient) UnpauseContainer(name string) error

func (*DockerClient) Upload added in v0.9.0

func (client *DockerClient) Upload(srcPath string, quiet bool) (string, error)

func (*DockerClient) Version

func (client *DockerClient) Version() (*Version, error)

func (*DockerClient) WaitContainer

func (client *DockerClient) WaitContainer(name string) (int, error)

type Error

type Error struct {
	StatusCode int
	Status     string
	// contains filtered or unexported fields
}

func (Error) Error

func (e Error) Error() string

type HostConfig

type HostConfig struct {
	Binds           []string
	ContainerIDFile string
	LxcConf         []KeyValuePair
	Privileged      bool
	PortBindings    map[string][]PortBinding
	Links           []string
	PublishAllPorts bool
	Dns             []string
	DnsSearch       []string
	ExtraHosts      []string
	VolumesFrom     []string
	Devices         []DeviceMapping
	NetworkMode     string
	IpcMode         string
	PidMode         string
	CapAdd          []string
	CapDrop         []string
	RestartPolicy   RestartPolicy
	SecurityOpt     []string
	ReadonlyRootfs  bool
}

https://github.com/docker/docker/blob/master/runconfig%2Fhostconfig.go#L101

type Image

type Image struct {
	Created     int64
	Id          string
	ParentId    string
	RepoTags    []string
	Size        int64
	VirtualSize int64
}

https://github.com/docker/docker/blob/master/graph%2Flist.go#L72

type ImageHistories

type ImageHistories []ImageHistory

func (ImageHistories) Len

func (images ImageHistories) Len() int

func (ImageHistories) Less

func (images ImageHistories) Less(i, j int) bool

func (ImageHistories) Swap

func (images ImageHistories) Swap(i, j int)

type ImageHistory

type ImageHistory struct {
	Created   int64
	CreatedBy string
	Id        string
	Size      int64
	Tags      []string
}

https://github.com/docker/docker/blob/master/graph%2Fhistory.go#L33

type ImageInfo

type ImageInfo struct {
	Id              string
	Parent          string
	Comment         string
	Created         time.Time
	Container       string
	ContainerConfig Config
	DockerVersion   string
	Author          string
	Config          Config
	Architecture    string
	Os              string
	Size            int64
	VirtualSize     int64
	Checksum        string
}

https://github.com/docker/docker/blob/master/graph%2Fservice.go#L140 https://github.com/docker/docker/blob/master/image%2Fimage.go#L24

type ImageSearchResult

type ImageSearchResult struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Official    bool   `json:"is_official"`
	Automated   bool   `json:"is_trusted"`
	Stars       int    `json:"star_count"`
}

type ImageSearchResults

type ImageSearchResults []ImageSearchResult

func (ImageSearchResults) Len

func (images ImageSearchResults) Len() int

func (ImageSearchResults) Swap

func (images ImageSearchResults) Swap(i, j int)

type Info

type Info struct {
	ID                 string
	Containers         int
	Images             int
	Driver             string
	DriverStatus       [][]string
	MemoryLimit        interface{} // int or bool
	SwapLimit          interface{} // int or bool
	IPv4Forwarding     interface{} // int or bool
	Debug              interface{} // int or bool
	NFd                int
	NGoroutines        int
	ExecutionDriver    string
	NEventsListener    int
	KernelVersion      string
	OperatingSystem    string
	IndexServerAddress string
	InitSha1           string
	InitPath           string
	NCPU               int
	MemTotal           int64
	DockerRootDir      string
	Name               string
	Labels             []string
}

https://github.com/docker/docker/blob/master/daemon%2Finfo.go#L67

type JSONError

type JSONError struct {
	Code    int    `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

func (*JSONError) Error

func (e *JSONError) Error() string

type JSONMessage

type JSONMessage struct {
	Stream          string        `json:"stream,omitempty"`
	Status          string        `json:"status,omitempty"`
	Progress        *JSONProgress `json:"progressDetail,omitempty"`
	ProgressMessage string        `json:"progress,omitempty"` //deprecated
	ID              string        `json:"id,omitempty"`
	From            string        `json:"from,omitempty"`
	Time            int64         `json:"time,omitempty"`
	Error           *JSONError    `json:"errorDetail,omitempty"`
	ErrorMessage    string        `json:"error,omitempty"` //deprecated
}

func (*JSONMessage) Display

func (jm *JSONMessage) Display(out io.Writer, isTerminal bool) (string, error)

type JSONProgress

type JSONProgress struct {
	Current int   `json:"current,omitempty"`
	Total   int   `json:"total,omitempty"`
	Start   int64 `json:"start,omitempty"`
}

func (*JSONProgress) String

func (p *JSONProgress) String() string

type NetworkSettings

type NetworkSettings struct {
	IPAddress              string
	IPPrefixLen            int
	MacAddress             string
	LinkLocalIPv6Address   string
	LinkLocalIPv6PrefixLen int
	GlobalIPv6Address      string
	GlobalIPv6PrefixLen    int
	Gateway                string
	IPv6Gateway            string
	Bridge                 string
	Ports                  map[string][]PortBinding
}

https://github.com/docker/docker/blob/master/daemon%2Fnetwork_settings.go#L11

type Processes

type Processes struct {
	Titles    []string
	Processes [][]string
}

type SortImagesByName

type SortImagesByName struct {
	ImageSearchResults
}

func (SortImagesByName) Less

func (by SortImagesByName) Less(i, j int) bool

type SortImagesByStars

type SortImagesByStars struct {
	ImageSearchResults
}

func (SortImagesByStars) Less

func (by SortImagesByStars) Less(i, j int) bool

type State

type State struct {
	Running    bool
	Paused     bool
	Restarting bool
	OOMKilled  bool
	Pid        int
	ExitCode   int
	Error      string
	StartedAt  time.Time
	FinishedAt time.Time
}

https://github.com/docker/docker/blob/master/daemon%2Fstate.go#L12

type Version

type Version struct {
	Version       string
	ApiVersion    string
	GoVersion     string
	GitCommit     string
	Os            string
	KernelVersion string
	Arch          string
}

https://github.com/docker/docker/blob/master/builtins%2Fbuiltins.go#L61

Jump to

Keyboard shortcuts

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