Documentation
¶
Index ¶
Constants ¶
const ContainerID = "containerID"
ContainerID is the key used to store the current ContainerID in the builder attributes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommitStep ¶
type CommitStep struct {
// contains filtered or unexported fields
}
CommitStep is a step that execute the delegated step and the commit the current container into a new image.
func (*CommitStep) Execute ¶
func (s *CommitStep) Execute(ctx context.Context, helper libmason.Helper, config *Config) (*Config, error)
Execute implements Step.Execute. It executes the step based on the specified config and helper.
func (*CommitStep) String ¶
func (s *CommitStep) String() string
type Config ¶
type Config struct { ImageID string Entrypoint strslice.StrSlice Cmd strslice.StrSlice // contains filtered or unexported fields }
Config holds builder configuration (like the ImageID and additionnal attributes).
type CreateStep ¶
type CreateStep struct { Cmd []string Entrypoint []string Stdin bool // contains filtered or unexported fields }
CreateStep is a step that will create a container (based on the specified attributes) and and execute the specified delegate step in this container.
func (*CreateStep) Execute ¶
func (s *CreateStep) Execute(ctx context.Context, helper libmason.Helper, config *Config) (*Config, error)
Execute implements Step.Execute. It executes the step based on the specified config and helper.
func (*CreateStep) String ¶
func (s *CreateStep) String() string
type FromStep ¶
type FromStep struct {
Reference string
}
FromStep is the top-level step that should be. It's only valid if there is no other step executed before. It will get the specified image and put it into the builder config.
type RemoveStep ¶
type RemoveStep struct {
// contains filtered or unexported fields
}
RemoveStep is a step that execute the delegated step and remove the current container
func (*RemoveStep) Execute ¶
func (s *RemoveStep) Execute(ctx context.Context, helper libmason.Helper, config *Config) (*Config, error)
Execute implements Step.Execute. It executes the step based on the specified config and helper.
func (*RemoveStep) String ¶
func (s *RemoveStep) String() string
type Step ¶
type Step interface { // Execute the current step "content" using the specified helper and config. // The step should return the/an updated config (can be untouched too). Execute(ctx context.Context, helper libmason.Helper, config *Config) (*Config, error) }
Step defines the method a builder step should define
func WithCommit ¶
WithCommit creates a Commit Step with the specified step.
func WithCreate ¶
WithCreate creates a Create step with the specified step (and argumeents)
func WithRemove ¶
WithRemove creates a Remove Step with the specfied step.
type StepBuilder ¶
type StepBuilder struct {
// contains filtered or unexported fields
}
StepBuilder is a builder that is composed of steps that are executed sequentially.
func NewBuilder ¶
func NewBuilder(helper libmason.Helper) *StepBuilder
NewBuilder Creates a new step builder
func WithLogFunc ¶
func WithLogFunc(builder *StepBuilder, fn func(string, ...interface{})) *StepBuilder
WithLogFunc sets the logging function to a builder and returns it. By default a builder has a noLog logging function (does nothing).
func WithSteps ¶
func WithSteps(builder *StepBuilder, steps []Step) *StepBuilder
WithSteps sets the steps to execute to a builder and returns it.