{"modulePath":"github.com/Coding/drone","version":"v0.3.1","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package docker\n\n## Constants\n\n```go\nconst (\n\tAPIVERSION        = 1.12\n\tDEFAULTHTTPPORT   = 2375\n\tDEFAULTUNIXSOCKET = \"/var/run/docker.sock\"\n\tDEFAULTPROTOCOL   = \"unix\"\n\tDEFAULTTAG        = \"latest\"\n\tVERSION           = \"0.8.0\"\n)\n```\n\n## Variables\n\n```go\nvar (\n\t// Returned if the specified resource does not exist.\n\tErrNotFound = errors.New(\"Not Found\")\n\n\t// Return if something going wrong\n\tErrInternalServer = errors.New(\"Internal Server Error\")\n\n\t// Returned if the caller attempts to make a call or modify a resource\n\t// for which the caller is not authorized.\n\t//\n\t// The request was a valid request, the caller's authentication credentials\n\t// succeeded but those credentials do not grant the caller permission to\n\t// access the resource.\n\tErrForbidden = errors.New(\"Forbidden\")\n\n\t// Returned if the call requires authentication and either the credentials\n\t// provided failed or no credentials were provided.\n\tErrNotAuthorized = errors.New(\"Unauthorized\")\n\n\t// Returned if the caller submits a badly formed request. For example,\n\t// the caller can receive this return if you forget a required parameter.\n\tErrBadRequest = errors.New(\"Bad Request\")\n)\n```\n\n```go\nvar Logging = true\n```\nEnables verbose logging to the Terminal window\n\n## Functions\n\n```go\nfunc GetHost(host string) string\n```\nGetHost returns the Docker Host address in order to connect to the Docker Daemon. It implements a very simple set of fallthrough logic to determine which address to use.\n\n```go\nfunc SplitProtoAddr(host string) (string, string)\n```\nSplitProtoAddr is a helper function that splits a host into Protocol and Address.\n\n## Types\n\n```go\ntype Client struct {\n\tImages     *ImageService\n\tContainers *ContainerService\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc New() *Client\n```\nNew creates an instance of the Docker Client\n\n```go\nfunc NewHost(uri string) *Client\n```\n\n```go\nfunc NewHostCert(uri string, cert, key []byte) (*Client, error)\n```\n\n```go\nfunc NewHostCertFile(uri, cert, key string) (*Client, error)\n```\n\n```go\nfunc (c *Client) CloseIdleConnections()\n```\n\n```go\nfunc (c *Client) Dial() (net.Conn, error)\n```\n\n```go\nfunc (c *Client) HTTPClient() *http.Client\n```\n\n```go\ntype Config struct {\n\tHostname        string\n\tDomainname      string\n\tUser            string\n\tMemory          int64 // Memory limit (in bytes)\n\tMemorySwap      int64 // Total memory usage (memory + swap); set `-1' to disable swap\n\tCpuShares       int64 // CPU shares (relative weight vs. other containers)\n\tAttachStdin     bool\n\tAttachStdout    bool\n\tAttachStderr    bool\n\tPortSpecs       []string // Deprecated - Can be in the format of 8080/tcp\n\tExposedPorts    map[Port]struct{}\n\tTty             bool // Attach standard streams to a tty, including stdin if it is not closed.\n\tOpenStdin       bool // Open stdin\n\tStdinOnce       bool // If true, close stdin after the 1 attached client disconnects.\n\tEnv             []string\n\tCmd             []string\n\tDns             []string\n\tImage           string // Name of the image as it was passed by the operator (eg. could be symbolic)\n\tVolumes         map[string]struct{}\n\tVolumesFrom     []string\n\tWorkingDir      string\n\tEntrypoint      []string\n\tNetworkDisabled bool\n}\n```\n\n```go\ntype Container struct {\n\tID string\n\n\tCreated time.Time\n\n\tPath string\n\tArgs []string\n\n\tConfig *Config\n\tState  State\n\tImage  string\n\n\tNetworkSettings *NetworkSettings\n\n\tSysInitPath    string\n\tResolvConfPath string\n\tHostnamePath   string\n\tHostsPath      string\n\tName           string\n\tDriver         string\n\n\tVolumes map[string]string\n\t// Store rw/ro in a separate structure to preserve reverse-compatibility on-disk.\n\t// Easier than migrating older container configs :)\n\tVolumesRW map[string]bool\n}\n```\n\n```go\ntype ContainerService struct {\n\t*Client\n}\n```\n\n```go\nfunc (c *ContainerService) Attach(id string, out io.Writer) error\n```\nAttach to the container to stream the stdout and stderr\n\n```go\nfunc (c *ContainerService) Create(conf *Config) (*Run, error)\n```\nCreate a Container\n\n```go\nfunc (c *ContainerService) Inspect(id string) (*Container, error)\n```\nStop the container id\n\n```go\nfunc (c *ContainerService) List() ([]*Containers, error)\n```\nList only running containers.\n\n```go\nfunc (c *ContainerService) ListAll() ([]*Containers, error)\n```\nList all containers\n\n```go\nfunc (c *ContainerService) Remove(id string) error\n```\nRemove the container id from the filesystem.\n\n```go\nfunc (c *ContainerService) Run(conf *Config, host *HostConfig, out io.Writer) (*Wait, error)\n```\nRun the container\n\n```go\nfunc (c *ContainerService) RunDaemon(conf *Config, host *HostConfig) (*Run, error)\n```\nRun the container as a Daemon\n\n```go\nfunc (c *ContainerService) RunDaemonPorts(image string, ports map[Port]struct{}) (*Run, error)\n```\n\n```go\nfunc (c *ContainerService) Start(id string, conf *HostConfig) error\n```\nStart the container id\n\n```go\nfunc (c *ContainerService) Stop(id string, timeout int) error\n```\nStop the container id\n\n```go\nfunc (c *ContainerService) Wait(id string) (*Wait, error)\n```\nBlock until container id stops, then returns the exit code\n\n```go\ntype Containers struct {\n\tID         string `json:\"Id\"`\n\tImage      string\n\tCommand    string\n\tCreated    int64\n\tStatus     string\n\tPorts      []Port\n\tSizeRw     int64\n\tSizeRootFs int64\n\tNames      []string\n}\n```\n\n```go\ntype Delete struct {\n\tDeleted  string `json:\",omitempty\"`\n\tUntagged string `json:\",omitempty\"`\n}\n```\n\n```go\ntype HostConfig struct {\n\tBinds           []string\n\tContainerIDFile string\n\tNetworkMode     string\n\tLxcConf         []KeyValuePair\n\tPrivileged      bool\n\tPortBindings    map[Port][]PortBinding\n\tLinks           []string\n\tPublishAllPorts bool\n}\n```\n\n```go\ntype Image struct {\n\tID              string    `json:\"id\"`\n\tParent          string    `json:\"parent,omitempty\"`\n\tComment         string    `json:\"comment,omitempty\"`\n\tCreated         time.Time `json:\"created\"`\n\tContainer       string    `json:\"container,omitempty\"`\n\tContainerConfig Config    `json:\"container_config,omitempty\"`\n\tDockerVersion   string    `json:\"docker_version,omitempty\"`\n\tAuthor          string    `json:\"author,omitempty\"`\n\tConfig          *Config   `json:\"config,omitempty\"`\n\tArchitecture    string    `json:\"architecture,omitempty\"`\n\tOS              string    `json:\"os,omitempty\"`\n\tSize            int64\n}\n```\n\n```go\ntype ImageService struct {\n\t*Client\n}\n```\n\n```go\nfunc (c *ImageService) Build(tag, dir string) error\n```\nBuild the Image\n\n```go\nfunc (c *ImageService) Create(image string) error\n```\nCreate an image, either by pull it from the registry or by importing it.\n\n```go\nfunc (c *ImageService) Inspect(name string) (*Image, error)\n```\nInspect the image\n\n```go\nfunc (c *ImageService) List() ([]*Images, error)\n```\nList Images\n\n```go\nfunc (c *ImageService) Pull(image string) error\n```\n\n```go\nfunc (c *ImageService) PullTag(name, tag string) error\n```\n\n```go\nfunc (c *ImageService) Remove(image string) ([]*Delete, error)\n```\nRemove the image name from the filesystem\n\n```go\ntype Images struct {\n\tID          string   `json:\"Id\"`\n\tRepoTags    []string `json:\",omitempty\"`\n\tCreated     int64\n\tSize        int64\n\tVirtualSize int64\n\tParentId    string `json:\",omitempty\"`\n\n\t// DEPRECATED\n\tRepository string `json:\",omitempty\"`\n\tTag        string `json:\",omitempty\"`\n}\n```\n\n```go\ntype KeyValuePair struct {\n\tKey   string\n\tValue string\n}\n```\n\n```go\ntype NetworkSettings struct {\n\tIPAddress   string\n\tIPPrefixLen int\n\tGateway     string\n\tBridge      string\n\tPortMapping map[string]PortMapping // Deprecated\n\tPorts       map[Port][]PortBinding\n}\n```\n\n```go\ntype Port string\n```\n80/tcp\n\n```go\nfunc NewPort(proto, port string) Port\n```\n\n```go\nfunc (p Port) Int() int\n```\n\n```go\nfunc (p Port) Port() string\n```\n\n```go\nfunc (p Port) Proto() string\n```\n\n```go\ntype PortBinding struct {\n\tHostIp   string\n\tHostPort string\n}\n```\n\n```go\ntype PortMapping map[string]string // Deprecated\n\n```\n\n```go\ntype Run struct {\n\tID       string   `json:\"Id\"`\n\tWarnings []string `json:\",omitempty\"`\n}\n```\n\n```go\ntype State struct {\n\tRunning    bool\n\tPid        int\n\tExitCode   int\n\tStartedAt  time.Time\n\tFinishedAt time.Time\n\tGhost      bool\n}\n```\n\n```go\ntype Top struct {\n\tTitles    []string\n\tProcesses [][]string\n}\n```\n\n```go\ntype Wait struct {\n\tStatusCode int\n}\n```\n\n","path":"github.com/Coding/drone/shared/build/docker","name":"docker","synopsis":"","isRedistributable":true}
