Documentation ¶
Index ¶
- type Client
- type ClientMock
- func (mock *ClientMock) ConfigInspectWithRaw(ctx context.Context, id string) (swarm.Config, []byte, error)
- func (mock *ClientMock) ConfigList(ctx context.Context, options types.ConfigListOptions) ([]swarm.Config, error)
- func (mock *ClientMock) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error)
- func (mock *ClientMock) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error)
- func (mock *ClientMock) Events(ctx context.Context, options types.EventsOptions) (<-chan events.Message, <-chan error)
- func (mock *ClientMock) Info(ctx context.Context) (types.Info, error)
- func (mock *ClientMock) NetworkInspect(ctx context.Context, networkID string, options types.NetworkInspectOptions) (types.NetworkResource, error)
- func (mock *ClientMock) NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error)
- func (mock *ClientMock) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error)
- func (mock *ClientMock) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error)
- type Utils
- type UtilsMock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error) Info(ctx context.Context) (types.Info, error) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error) NetworkInspect(ctx context.Context, networkID string, options types.NetworkInspectOptions) (types.NetworkResource, error) NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) ConfigList(ctx context.Context, options types.ConfigListOptions) ([]swarm.Config, error) ConfigInspectWithRaw(ctx context.Context, id string) (swarm.Config, []byte, error) Events(ctx context.Context, options types.EventsOptions) (<-chan events.Message, <-chan error) }
Client is an interface with needed functionalities from docker client
func WrapClient ¶
WrapClient creates a new docker client wrapper
type ClientMock ¶
type ClientMock struct { ContainersData []types.Container ServicesData []swarm.Service ConfigsData []swarm.Config TasksData []swarm.Task NetworksData []types.NetworkResource InfoData types.Info ContainerInspectData map[string]types.ContainerJSON NetworkInspectData map[string]types.NetworkResource EventsChannel chan events.Message ErrorsChannel chan error }
ClientMock allows easily mocking of docker client data
func (*ClientMock) ConfigInspectWithRaw ¶
func (mock *ClientMock) ConfigInspectWithRaw(ctx context.Context, id string) (swarm.Config, []byte, error)
ConfigInspectWithRaw return sinformation about a specific config
func (*ClientMock) ConfigList ¶
func (mock *ClientMock) ConfigList(ctx context.Context, options types.ConfigListOptions) ([]swarm.Config, error)
ConfigList list all configs
func (*ClientMock) ContainerInspect ¶
func (mock *ClientMock) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error)
ContainerInspect returns information about a specific container
func (*ClientMock) ContainerList ¶
func (mock *ClientMock) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error)
ContainerList list all containers
func (*ClientMock) Events ¶
func (mock *ClientMock) Events(ctx context.Context, options types.EventsOptions) (<-chan events.Message, <-chan error)
Events listen for events in docker
func (*ClientMock) NetworkInspect ¶
func (mock *ClientMock) NetworkInspect(ctx context.Context, networkID string, options types.NetworkInspectOptions) (types.NetworkResource, error)
NetworkInspect returns information about a specific network
func (*ClientMock) NetworkList ¶
func (mock *ClientMock) NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error)
NetworkList list all networks
func (*ClientMock) ServiceList ¶
func (mock *ClientMock) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error)
ServiceList list all services
func (*ClientMock) TaskList ¶
func (mock *ClientMock) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error)
TaskList list all tasks
type UtilsMock ¶
UtilsMock allows mocking docker Utils
func (*UtilsMock) GetCurrentContainerID ¶
GetCurrentContainerID returns the id of the container running this application