Documentation
¶
Index ¶
- type Compose
- func (c *Compose) Cleanup(ctx context.Context) error
- func (c *Compose) Create(ctx context.Context) error
- func (c *Compose) Down(ctx context.Context) error
- func (c *Compose) IsRunning(ctx context.Context) (bool, error)
- func (c *Compose) Logs(ctx context.Context) (logs.LogStreams, error)
- func (c *Compose) Name() string
- func (c *Compose) Project() string
- func (c *Compose) Resources(ctx context.Context) (scaffold.ResourceStatus, error)
- type Option
- func WithBinary(binary string, argsPrefix ...string) Option
- func WithEmbeddedFile(name string, content []byte) Option
- func WithFile(path string) Option
- func WithProject(project string) Option
- func WithReadyCheck(ready Ready) Option
- func WithWaitTimeout(timeout time.Duration) Option
- func WithoutWait() Option
- type Ready
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compose ¶
type Compose struct {
// contains filtered or unexported fields
}
Compose wraps a Docker Compose project as a scaffold service.
func (*Compose) Create ¶
Create starts the Compose project. If Compose fails after creating partial resources, Create attempts to clean them up before returning the error.
func (*Compose) Down ¶
Down removes resources for this Compose project, including resources created by an earlier process using the same project name.
func (*Compose) IsRunning ¶
IsRunning returns true when any discovered Compose container is running.
type Option ¶
type Option func(*Compose)
Option configures a Compose service.
func WithBinary ¶
WithBinary overrides the Compose command. The default is docker compose.
func WithEmbeddedFile ¶
WithEmbeddedFile adds Compose file contents compiled into the Go binary, usually from go:embed.
func WithProject ¶
WithProject sets the Docker Compose project name used for commands and label-based discovery.
func WithReadyCheck ¶
WithReadyCheck adds an application-level readiness check after Compose up.
func WithWaitTimeout ¶
WithWaitTimeout configures the default docker compose --wait timeout.
func WithoutWait ¶
func WithoutWait() Option
WithoutWait disables docker compose --wait. Create returns when Compose finishes creating containers.