Documentation
¶
Index ¶
- Constants
- func FormatError(cmd *exec.Cmd, stdout []byte, err error) error
- type Action
- type Attributes
- type BuildConfig
- type Config
- type DockerComposeClient
- type Event
- type FakeDCClient
- func (c *FakeDCClient) Config(ctx context.Context, pathToConfig string) (string, error)
- func (c *FakeDCClient) Down(ctx context.Context, pathToConfig string, stdout, stderr io.Writer) error
- func (c *FakeDCClient) SendEvent(evt Event) error
- func (c *FakeDCClient) Services(ctx context.Context, pathToConfig string) (string, error)
- func (c *FakeDCClient) SetLogOutput(output string)
- func (c *FakeDCClient) StreamEvents(ctx context.Context, pathToConfig string) (<-chan string, error)
- func (c *FakeDCClient) StreamLogs(ctx context.Context, pathToConfig, serviceName string) (io.ReadCloser, error)
- func (c *FakeDCClient) Up(ctx context.Context, pathToConfig, serviceName string, ...) error
- type Service
- type ServiceConfig
- type State
- type Type
Constants ¶
View Source
const ( StatusDown = "down" StatusInProg = "in progress" StatusUp = "up" )
Three hacky states just for now to get something into the hud.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action string
const ( // CONTAINER actions ActionAttach Action = "attach" ActionCreate Action = "create" ActionDie Action = "die" ActionExecDie Action = "exec_die" ActionExecAttach Action = "exec_attach" ActionExecCreate Action = "exec_create" ActionKill Action = "kill" ActionRename Action = "rename" ActionRestart Action = "restart" ActionStart Action = "start" ActionStop Action = "stop" ActionUpdate Action = "update" )
func (*Action) UnmarshalJSON ¶
type Attributes ¶
type BuildConfig ¶
type Config ¶
type Config struct {
Services map[string]ServiceConfig
}
Go representations of docker-compose.yml (Add fields as we need to support more things)
func (*Config) UnmarshalYAML ¶
We use a custom Unmarshal method here so that we can store the RawYAML in addition to unmarshaling the fields we care about into structs.
type DockerComposeClient ¶
type DockerComposeClient interface { Up(ctx context.Context, configPath, serviceName string, stdout, stderr io.Writer) error Down(ctx context.Context, configPath string, stdout, stderr io.Writer) error StreamLogs(ctx context.Context, configPath, serviceName string) (io.ReadCloser, error) StreamEvents(ctx context.Context, configPath string) (<-chan string, error) Config(ctx context.Context, configPath string) (string, error) Services(ctx context.Context, configPath string) (string, error) }
func NewDockerComposeClient ¶
func NewDockerComposeClient() 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 ¶
type FakeDCClient ¶
type FakeDCClient struct {
// contains filtered or unexported fields
}
func NewFakeDockerComposeClient ¶
func NewFakeDockerComposeClient(t *testing.T) *FakeDCClient
func (*FakeDCClient) SendEvent ¶
func (c *FakeDCClient) SendEvent(evt Event) error
func (*FakeDCClient) SetLogOutput ¶
func (c *FakeDCClient) SetLogOutput(output string)
func (*FakeDCClient) StreamEvents ¶
func (*FakeDCClient) StreamLogs ¶
func (c *FakeDCClient) StreamLogs(ctx context.Context, pathToConfig, serviceName string) (io.ReadCloser, error)
type Service ¶
type Service struct { Name string Context string DfPath string // Currently just use these to diff against when config files are edited to see if manifest has changed ServiceConfig []byte DfContents []byte }
A docker-compose service, according to Tilt.
type ServiceConfig ¶
type ServiceConfig struct { RawYAML []byte // We store this to diff against when docker-compose.yml is edited to see if the manifest has changed Build BuildConfig `yaml:"build"` }
type State ¶
func (State) ResourceState ¶
func (State) ResourceState()
func (State) WithCurrentLog ¶
func (State) WithStatus ¶
type Type ¶
type Type string
https://docs.docker.com/engine/reference/commandline/events/
const ( // Add 'types' here (and to `UnmarshalJSON` below) as we support them TypeContainer Type = "container" )
func (*Type) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.