Documentation ¶
Index ¶
- Constants
- func FormatError(cmd *exec.Cmd, stdout []byte, err error) error
- type Action
- type Attributes
- type DockerComposeClient
- type Event
- type FakeDCClient
- func (c *FakeDCClient) Config(ctx context.Context, configPaths []string) (string, error)
- func (c *FakeDCClient) ContainerID(ctx context.Context, configPaths []string, serviceName model.TargetName) (container.ID, error)
- func (c *FakeDCClient) Down(ctx context.Context, configPaths []string, stdout, stderr io.Writer) error
- func (c *FakeDCClient) SendEvent(evt Event) error
- func (c *FakeDCClient) Services(ctx context.Context, configPaths []string) (string, error)
- func (c *FakeDCClient) StreamEvents(ctx context.Context, configPaths []string) (<-chan string, error)
- func (c *FakeDCClient) StreamLogs(ctx context.Context, configPaths []string, serviceName model.TargetName) (io.ReadCloser, error)
- func (c *FakeDCClient) Up(ctx context.Context, configPaths []string, serviceName model.TargetName, ...) error
- type State
- func (s State) Log() model.Log
- func (State) ResourceState()
- func (s State) WithContainerID(cID container.ID) State
- func (s State) WithCurrentLog(l model.Log) State
- func (s State) WithStartTime(time time.Time) State
- func (s State) WithStatus(status Status) State
- func (s State) WithStopping(stopping bool) State
- type Status
- type Type
- type UpCall
Constants ¶
View Source
const ( StatusDown = Status("Down") StatusInProg = Status("In Progress") StatusUp = Status("OK") StatusCrash = Status("Crash") )
Three hacky states just for now to get something into the hud.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action int
const ( // CONTAINER actions ActionUnknown Action = iota ActionAttach ActionCommit ActionCopy ActionCreate ActionDestroy ActionDie ActionExecCreate ActionExecDetach ActionExecDie ActionExecStart ActionExport ActionHealthStatus ActionKill ActionOom ActionPause ActionRename ActionResize ActionRestart ActionStart ActionStop ActionTop ActionUnpause ActionUpdate )
func (Action) MarshalJSON ¶ added in v0.4.3
func (*Action) UnmarshalJSON ¶
type Attributes ¶
type DockerComposeClient ¶
type DockerComposeClient interface { Up(ctx context.Context, configPaths []string, serviceName model.TargetName, shouldBuild bool, stdout, stderr io.Writer) error Down(ctx context.Context, configPaths []string, stdout, stderr io.Writer) error StreamLogs(ctx context.Context, configPaths []string, serviceName model.TargetName) (io.ReadCloser, error) StreamEvents(ctx context.Context, configPaths []string) (<-chan string, error) Config(ctx context.Context, configPaths []string) (string, error) Services(ctx context.Context, configPaths []string) (string, error) ContainerID(ctx context.Context, configPaths []string, serviceName model.TargetName) (container.ID, error) }
func NewDockerComposeClient ¶
func NewDockerComposeClient(env docker.LocalEnv) DockerComposeClient
TODO(dmiller): we might want to make this take a path to the docker-compose config so we don't have to keep passing it in.
type Event ¶
type Event struct { Time string `json:"time"` // todo: time Type Type `json:"type"` Action Action `json:"action"` ID string `json:"id"` // todo: type? Service string `json:"service"` Attributes Attributes `json:"attributes"` }
func EventFromJsonStr ¶
func (Event) GuessStatus ¶
func (Event) IsStartupEvent ¶ added in v0.4.2
func (Event) IsStopEvent ¶ added in v0.4.3
type FakeDCClient ¶
type FakeDCClient struct { RunLogOutput map[model.TargetName]<-chan string ContainerIdOutput container.ID ConfigOutput string ServicesOutput string UpCalls []UpCall DownError error // contains filtered or unexported fields }
func NewFakeDockerComposeClient ¶
func NewFakeDockerComposeClient(t *testing.T, ctx context.Context) *FakeDCClient
func (*FakeDCClient) ContainerID ¶ added in v0.5.1
func (c *FakeDCClient) ContainerID(ctx context.Context, configPaths []string, serviceName model.TargetName) (container.ID, error)
func (*FakeDCClient) SendEvent ¶
func (c *FakeDCClient) SendEvent(evt Event) error
func (*FakeDCClient) StreamEvents ¶
func (*FakeDCClient) StreamLogs ¶
func (c *FakeDCClient) StreamLogs(ctx context.Context, configPaths []string, serviceName model.TargetName) (io.ReadCloser, error)
type State ¶
type State struct { Status Status ContainerID container.ID CurrentLog model.Log StartTime time.Time IsStopping bool }
func (State) ResourceState ¶
func (State) ResourceState()
func (State) WithContainerID ¶ added in v0.5.0
func (State) WithStatus ¶
func (State) WithStopping ¶ added in v0.4.3
type Type ¶
type Type int
https://docs.docker.com/engine/reference/commandline/events/
func (Type) MarshalJSON ¶ added in v0.4.3
func (*Type) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.