Documentation
¶
Index ¶
- func Build(path string) (tag string, err error)
- func Client() (client *docker.Client, err error)
- func CreateNetwork(namespace []string) (networkID string, err error)
- func DeleteNetwork(namespace []string) (err error)
- func FindContainer(namespace []string) (container types.ContainerJSON, err error)
- func FindNetwork(namespace []string) (network types.NetworkResource, err error)
- func FindService(namespace []string) (service swarm.Service, err error)
- func IsServiceRunning(namespace []string) (result bool, err error)
- func IsServiceStopped(namespace []string) (result bool, err error)
- func ListServices(label string) (services []swarm.Service, err error)
- func Namespace(ss []string) string
- func ServiceLogs(namespace []string) (reader io.ReadCloser, err error)
- func SharedNetworkID() (networkID string, err error)
- func StartService(options ServiceOptions) (serviceID string, err error)
- func StopService(namespace []string) (err error)
- func WaitForContainerStatus(namespace []string, status StatusType) (err error)
- type BuildResponse
- type Mount
- type Port
- type ServiceOptions
- type StatusType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateNetwork ¶
CreateNetwork creates a Docker Network with a namespace
func DeleteNetwork ¶
DeleteNetwork deletes a Docker Network associated with a namespace
func FindContainer ¶
func FindContainer(namespace []string) (container types.ContainerJSON, err error)
FindContainer returns a docker container if exist
func FindNetwork ¶
func FindNetwork(namespace []string) (network types.NetworkResource, err error)
FindNetwork finds a Docker Network by a namespace. If no network if found, an error is returned.
func FindService ¶
FindService returns the Docker Service. Return error if not found.
func IsServiceRunning ¶
IsServiceRunning returns true if the service is running, false otherwise
func IsServiceStopped ¶
IsServiceStopped returns true if the service is stopped, false otherwise
func ListServices ¶
ListServices returns existing docker services matching a specific label name
func ServiceLogs ¶
func ServiceLogs(namespace []string) (reader io.ReadCloser, err error)
ServiceLogs returns the logs of a service
func SharedNetworkID ¶
SharedNetworkID returns the id of the shared network
func StartService ¶
func StartService(options ServiceOptions) (serviceID string, err error)
StartService starts a docker service
func StopService ¶
StopService stops a docker service
func WaitForContainerStatus ¶
func WaitForContainerStatus(namespace []string, status StatusType) (err error)
WaitForContainerStatus wait for the container to have the provided status until it reach the timeout
Types ¶
type BuildResponse ¶
type BuildResponse struct {
Stream string `json:"stream"`
}
BuildResponse is the object that is returned by the docker api in json
type ServiceOptions ¶
type ServiceOptions struct {
Image string
Namespace []string
Ports []Port
Mounts []Mount
Env []string
Args []string
NetworksID []string
Labels map[string]string
}
ServiceOptions is a simplify version of swarm.ServiceSpec that can be created it.
type StatusType ¶
type StatusType uint
StatusType of the service
const ( STOPPED StatusType = 1 RUNNING StatusType = 2 )
status for services
func ServiceStatus ¶
func ServiceStatus(namespace []string) (status StatusType, err error)
ServiceStatus return the status of the Docker Swarm Servicer
func Status ¶
func Status(namespace []string) (status StatusType, err error)
Status returns the status of a docker container