Documentation
¶
Index ¶
- func CredentialsStore(configFile configfile.ConfigFile) credentials.Store
- func DefaultAuthHandler() (string, error)
- func EncodeAuth(auth types.AuthConfig) (string, error)
- func EncodedAuth(ref string) (string, error)
- func EncodedConfigAuth(ref string) (string, error)
- func EncodedEnvAuth(ref string) (string, error)
- func ParseServerAddress(ref string) (string, error)
- type ByCreated
- type Client
- type Container
- type Filter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CredentialsStore ¶
func CredentialsStore(configFile configfile.ConfigFile) credentials.Store
CredentialsStore returns a new credentials store based on the settings provided in the configuration file.
func DefaultAuthHandler ¶
*
- This function will be invoked if an AuthConfig is rejected
- It could be used to return a new value for the "X-Registry-Auth" authentication header,
- but there's no point trying again with the same value as used in AuthConfig
func EncodeAuth ¶
func EncodeAuth(auth types.AuthConfig) (string, error)
* Base64 encode an AuthConfig struct for transmission over HTTP
func EncodedAuth ¶
*
- Return an encoded auth config for the given registry
- loaded from environment variables or docker config
- as available in that order
func EncodedConfigAuth ¶
* Return an encoded auth config for the given registry * loaded from the docker config * Returns an empty string if credentials cannot be found for the referenced server * The docker config must be mounted on the container
func EncodedEnvAuth ¶
* Return an encoded auth config for the given registry * loaded from environment variables * Returns an error if authentication environment variables have not been set
func ParseServerAddress ¶
Types ¶
type ByCreated ¶
type ByCreated []Container
ByCreated allows a list of Container structs to be sorted by the container's created date.
type Client ¶
type Client interface { ListContainers(Filter) ([]Container, error) StopContainer(Container, time.Duration) error StartContainer(Container) error RenameContainer(Container, string) error IsContainerStale(Container) (bool, error) RemoveImage(Container) error }
A Client is the interface through which watchtower interacts with the Docker API.
func NewClient ¶
NewClient returns a new Client instance which can be used to interact with the Docker API. The client reads its configuration from the following environment variables:
- DOCKER_HOST the docker-engine host to send api requests to
- DOCKER_TLS_VERIFY whether to verify tls certificates
- DOCKER_API_VERSION the minimum docker api version to work with
type Container ¶
type Container struct { Stale bool // contains filtered or unexported fields }
Container represents a running Docker container.
func NewContainer ¶
func NewContainer(containerInfo *types.ContainerJSON, imageInfo *types.ImageInspect) *Container
NewContainer returns a new Container instance instantiated with the specified ContainerInfo and ImageInfo structs.
func SortByDependencies ¶
SortByDependencies will sort the list of containers taking into account any links between containers. Container with no outgoing links will be sorted to the front of the list while containers with links will be sorted after all of their dependencies. This sort order ensures that linked containers can be started in the correct order.
func (Container) Enabled ¶ added in v0.2.0
Enabled returns the value of the container enabled label and if the label was set.
func (Container) ImageID ¶
ImageID returns the ID of the Docker image that was used to start the container.
func (Container) ImageName ¶
ImageName returns the name of the Docker image that was used to start the container. If the original image was specified without a particular tag, the "latest" tag is assumed.
func (Container) IsWatchtower ¶
IsWatchtower returns a boolean flag indicating whether or not the current container is the watchtower container itself. The watchtower container is identified by the presence of the "com.centurylinklabs.watchtower" label in the container metadata.
func (Container) Links ¶
Links returns a list containing the names of all the containers to which this container is linked.
func (Container) StopSignal ¶
StopSignal returns the custom stop signal (if any) that is encoded in the container's metadata. If the container has not specified a custom stop signal, the empty string "" is returned.