Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) AppName() string
- func (c *Client) Check() error
- func (c *Client) ContainerAddressInNetwork(containerName, environmentName, networkName string) (string, error)
- func (c *Client) ContainerGatewayInNetwork(containerName, networkName string) (string, error)
- func (c *Client) ContainerIDByName(containerName string) (string, error)
- func (c *Client) ContainerNamesByName(containerName string) ([]string, error)
- func (c *Client) ContainerRunning(container string) bool
- func (c *Client) ContainerStateByName(containerName string) (string, error)
- func (c *Client) EnvName() string
- func (c *Client) NetworkExist(networkName string) (bool, error)
- func (c *Client) NetworkNamesByLabel(label string) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrDockerAPIIsUnreachable occurs when Docker is not running // or the user who runs the application cannot call Docker API. ErrDockerAPIIsUnreachable = func(err error) error { return fmt.Errorf("docker api is unreachable: %w", err) } // ErrDockerVersionMismatch occurs when the Docker version is too old. ErrDockerVersionMismatch = func(s string) error { return fmt.Errorf("docker version is too old: %s", s) } // ErrCannotFindContainer occurs when the application cannot find the requested container. ErrCannotFindContainer = func(s string, err error) error { return fmt.Errorf("cannot find container: %s, error: %w", s, err) } // ErrNoContainersFound occurs when the application found zero containers. ErrNoContainersFound = func() error { return fmt.Errorf("no containers found") } // ErrTooManyContainersFound occurs when the application found more than 1 container. ErrTooManyContainersFound = func(s string) error { return fmt.Errorf("too many containers found: %s", s) } // ErrCannotFindNetwork occurs when the application cannot find the requested network during container inspection. ErrCannotFindNetwork = func(s string) error { return fmt.Errorf("cannot find network: %s", s) } )
Functions ¶
This section is empty.
Types ¶
type Client ¶
func (*Client) ContainerAddressInNetwork ¶
func (c *Client) ContainerAddressInNetwork(containerName, environmentName, networkName string) (string, error)
ContainerAddressInNetwork returns the container IP address in the specific network.
func (*Client) ContainerGatewayInNetwork ¶
ContainerGatewayInNetwork returns the container IP address in the specific network.
func (*Client) ContainerIDByName ¶
ContainerIDByName returns a container ID of the containerName running in the current environment.
func (*Client) ContainerNamesByName ¶
ContainerNamesByName returns a container names of the containerName running in the current environment.
func (*Client) ContainerRunning ¶
ContainerRunning returns true if container is running.
func (*Client) ContainerStateByName ¶
ContainerStateByName returns the container state of the containerName running in the current environment.
func (*Client) NetworkExist ¶
NetworkExist returns true if the docker network exists.
Click to show internal directories.
Click to hide internal directories.