Documentation ¶
Index ¶
- type DockerClient
- func (mock *DockerClient) AddContainer(container *docker.Container) error
- func (mock *DockerClient) AddEventListener(channel chan<- *docker.APIEvents) error
- func (mock *DockerClient) InspectContainer(id string) (*docker.Container, error)
- func (mock *DockerClient) ListContainers(opts docker.ListContainersOptions) ([]docker.APIContainers, error)
- func (mock *DockerClient) RemoveContainer(id string) error
- type Handler
- type STSClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DockerClient ¶
type DockerClient struct {
// contains filtered or unexported fields
}
DockerClient implements the github.com/swipely/iam-docker/src/docker.RawClient interface. To fake a running container, it must be added to the containersByID map.
func NewDockerClient ¶
func NewDockerClient() *DockerClient
NewDockerClient creates a new mock Docker client.
func (*DockerClient) AddContainer ¶
func (mock *DockerClient) AddContainer(container *docker.Container) error
AddContainer adds the container the to the store and fires off the event listeners.
func (*DockerClient) AddEventListener ¶
func (mock *DockerClient) AddEventListener(channel chan<- *docker.APIEvents) error
AddEventListener is a no-op.
func (*DockerClient) InspectContainer ¶
func (mock *DockerClient) InspectContainer(id string) (*docker.Container, error)
InspectContainer looks up a container by its ID.
func (*DockerClient) ListContainers ¶
func (mock *DockerClient) ListContainers(opts docker.ListContainersOptions) ([]docker.APIContainers, error)
ListContainers returns a docker.APIContainer for each container stored in the mock.
func (*DockerClient) RemoveContainer ¶
func (mock *DockerClient) RemoveContainer(id string) error
RemoveContainer removes the container and fires off event listeners.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a mock http.Handler.
func NewHandler ¶
func NewHandler(serveHTTP func(writer http.ResponseWriter, request *http.Request)) *Handler
NewHandler creates a new mock handler.
type STSClient ¶
type STSClient struct {
AssumableRoles map[string]*sts.Credentials
}
STSClient implements github.com/swipely/iam-docker/src/iam.STSClient.
func (*STSClient) AssumeRole ¶
func (mock *STSClient) AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error)
AssumeRole uses the mock's AssumableRoles to try to assume a new IAM role.