Documentation ¶
Index ¶
- Constants
- Variables
- func CreateClients(args argsType.Args) map[string]Client
- type Actions
- type Client
- type Container
- type ContainerAction
- type ContainerEvent
- type ContainerStore
- func (s *ContainerStore) Client() Client
- func (s *ContainerStore) List() ([]Container, error)
- func (s *ContainerStore) Subscribe(ctx context.Context, events chan ContainerEvent)
- func (s *ContainerStore) SubscribeNewContainers(ctx context.Context, containers chan Container)
- func (s *ContainerStore) Unsubscribe(ctx context.Context)
- type DockerCLI
- type Host
- type StdType
Constants ¶
View Source
const STDALL = STDOUT | STDERR
Variables ¶
View Source
var Action = Actions{ START: ActionStart, STOP: ActionStop, RESTART: ActionRestart, PULL: ActionPull, }
View Source
var ContainerActions = []ContainerAction{ ActionStart, ActionStop, ActionRestart, ActionPull, }
View Source
var ParenthesisRe = regexp.MustCompile(`\(([a-zA-Z]+)\)`)
Functions ¶
Types ¶
type Actions ¶
type Actions struct { START ContainerAction STOP ContainerAction RESTART ContainerAction PULL ContainerAction }
type Client ¶
type Client interface { ListContainers() ([]Container, error) FindContainer(string) (Container, error) ContainerLogs(context.Context, string, *time.Time, StdType) (io.ReadCloser, error) Events(context.Context, chan<- ContainerEvent) error ContainerLogsBetweenDates(context.Context, string, time.Time, time.Time, StdType) (io.ReadCloser, error) Ping(context.Context) (types.Ping, error) Host() *Host ContainerActions(action ContainerAction, containerID string) error IsSwarmMode() bool SystemInfo() system.Info }
func NewClientWithFilters ¶
NewClientWithFilters creates a new instance of Client with docker filters
type Container ¶
type Container struct { ID string `json:"id"` Names []string `json:"names"` Name string `json:"name"` Image string `json:"image"` ImageID string `json:"imageId"` Command string `json:"command"` Created time.Time `json:"created"` StartedAt *time.Time `json:"startedAt,omitempty"` State string `json:"state"` Status string `json:"status"` Health string `json:"health,omitempty"` Host string `json:"host,omitempty"` Tty bool `json:"-"` Labels map[string]string `json:"labels,omitempty"` }
Container represents an internal representation of docker containers
func (*Container) GetDescription ¶
func (*Container) GetDescriptionFull ¶
type ContainerAction ¶
type ContainerAction string
const ( ActionStart ContainerAction = "start" ActionStop ContainerAction = "stop" ActionRestart ContainerAction = "restart" ActionPull ContainerAction = "pull" )
type ContainerEvent ¶
type ContainerEvent struct { ActorID string `json:"actorId"` Name string `json:"name"` Host string `json:"host"` }
ContainerEvent represents events that are triggered
type ContainerStore ¶
type ContainerStore struct {
// contains filtered or unexported fields
}
func NewContainerStore ¶
func NewContainerStore(ctx context.Context, client Client) *ContainerStore
func (*ContainerStore) Client ¶
func (s *ContainerStore) Client() Client
func (*ContainerStore) List ¶
func (s *ContainerStore) List() ([]Container, error)
func (*ContainerStore) Subscribe ¶
func (s *ContainerStore) Subscribe(ctx context.Context, events chan ContainerEvent)
func (*ContainerStore) SubscribeNewContainers ¶
func (s *ContainerStore) SubscribeNewContainers(ctx context.Context, containers chan Container)
func (*ContainerStore) Unsubscribe ¶
func (s *ContainerStore) Unsubscribe(ctx context.Context)
type DockerCLI ¶
type DockerCLI interface { ContainerList(context.Context, container.ListOptions) ([]types.Container, error) ContainerLogs(context.Context, string, container.LogsOptions) (io.ReadCloser, error) Events(context.Context, events.ListOptions) (<-chan events.Message, <-chan error) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error) ContainerStats(ctx context.Context, containerID string, stream bool) (container.StatsResponse, error) Ping(ctx context.Context) (types.Ping, error) ContainerStart(ctx context.Context, containerID string, options container.StartOptions) error ContainerStop(ctx context.Context, containerID string, options container.StopOptions) error ContainerRestart(ctx context.Context, containerID string, options container.StopOptions) error Info(ctx context.Context) (system.Info, error) ImagePull(ctx context.Context, refStr string, options image.PullOptions) (io.ReadCloser, error) ImageInspectWithRaw(ctx context.Context, imageID string) (types.ImageInspect, []byte, error) }
type Host ¶
type Host struct { Name string `json:"name"` ID string `json:"id"` URL *url.URL `json:"-"` CertPath string `json:"-"` CACertPath string `json:"-"` KeyPath string `json:"-"` ValidCerts bool `json:"-"` NCPU int `json:"nCPU"` MemTotal int64 `json:"memTotal"` }
func ParseConnection ¶
func (*Host) GetDescription ¶
Click to show internal directories.
Click to hide internal directories.