go-tstr / tstr / dep / compose
github.com/go-tstr/tstr/dep/compose
go get github.com/go-tstr/tstr/dep/compose@v0.1.4
Constants
const ErrCreateStack = strerr.Error("failed to create compose stack")Types
type Compose
type Compose struct {
// contains filtered or unexported fields
}func New
func New(opts ...Opt) *ComposeNew creates new Compose depencency. By default it applies tc.Wait(true) and tc.RemoveOrphans(true) options. Those can be overwritten by WithUpOptions and WithDownOptions.
func (*Compose) Ready
func (c *Compose) Ready() errorfunc (*Compose) Start
func (c *Compose) Start() errorfunc (*Compose) Stop
func (c *Compose) Stop() errortype Opt
type Opt func(*Compose) errorOpt is option type for OptCompose.
func WithDownOptions
func WithDownOptions(opts ...tc.StackDownOption) OptWithDownOptions sets options for compose.Down().
func WithEnv
func WithEnv(env map[string]string) OptWithEnv sets environment variables for compose.
func WithFile
func WithFile(file string) OptWithFile creates compose stack from file.
func WithOsEnv
func WithOsEnv() OptWithOsEnv passes environment from OS to compose.
func WithReadyFn
func WithReadyFn(fn func(tc.ComposeStack) error) OptWithReadyFn sets ready function.
func WithStack
func WithStack(s tc.ComposeStack) OptWithStack sets ComposeStack.
func WithUpOptions
func WithUpOptions(opts ...tc.StackUpOption) OptWithUpOptions sets options for compose.Up().
func WithWaitForService
func WithWaitForService(service string, strategy wait.Strategy) OptWithWaitForService makes compose up wait for specific service with given strategy.