mock

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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.

func (*Handler) ServeHTTP

func (handler *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request)

type STSClient

type STSClient struct {
	AssumableRoles map[string]*sts.Credentials
}

STSClient implements github.com/swipely/iam-docker/src/iam.STSClient.

func NewSTSClient

func NewSTSClient() *STSClient

NewSTSClient returns a mock 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL