bobrun

package
v0.0.0-...-b7a57f2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidRunType = fmt.Errorf("invalid run type")

Functions

This section is empty.

Types

type Run

type Run struct {
	Type RunType

	// ComposePath is the path to a docker-compose file or binary
	// Default filename is used when empty.
	Path string

	// DependsOn run or build tasks
	DependsOn []string `yaml:"dependsOn"`

	// InitDirty runs run after this task has started and `initOnce`conpleted.
	InitDirty string `yaml:"init"`

	// InitOnceDirty runs once during the lifetime of a run
	// after the actual task has started.
	InitOnceDirty string `yaml:"initOnce"`

	// DependenciesDirty read from the bobfile
	DependenciesDirty []string `yaml:"dependencies"`
	// contains filtered or unexported fields
}

func (*Run) Command

func (r *Run) Command(ctx context.Context) (rc ctl.Command, err error)

Command creates a run cmd and returns a Command interface to control it. To shutdown a Command() use a cancelable context.

func (*Run) Dependencies

func (r *Run) Dependencies() []nix.Dependency

func (*Run) Dir

func (r *Run) Dir() string

func (*Run) Env

func (r *Run) Env() []string

func (*Run) Init

func (r *Run) Init() []string

func (*Run) InitOnce

func (r *Run) InitOnce() []string

func (*Run) Name

func (r *Run) Name() string

func (*Run) SetDependencies

func (r *Run) SetDependencies(dependencies []nix.Dependency)

func (*Run) SetDir

func (r *Run) SetDir(dir string)

func (*Run) SetEnv

func (r *Run) SetEnv(env []string)

func (*Run) SetName

func (r *Run) SetName(name string)

func (*Run) SetNixpkgs

func (r *Run) SetNixpkgs(nixpkgs string)

func (*Run) UnmarshalYAML

func (r *Run) UnmarshalYAML(value *yaml.Node) (err error)

func (*Run) WrapWithInit

func (r *Run) WrapWithInit(ctx context.Context, rc ctl.Command) (_ ctl.Command, err error)

WrapCommand takes a ctl to add init functionality defined in the run task.

type RunMap

type RunMap map[string]*Run

func (RunMap) CollectNixDependenciesForTasks

func (rm RunMap) CollectNixDependenciesForTasks(whitelist []string) ([]nix.Dependency, error)

CollectNixDependenciesForTasks will collect all nix dependencies for task taskName in nixDependencies slice

func (RunMap) Sanitize

func (rm RunMap) Sanitize() (err error)

Sanitize run map and write filtered & sanitized properties from dirty members to plain (e.g. dirtyInit -> init)

func (RunMap) String

func (rm RunMap) String() string

type RunType

type RunType string
const (
	RunTypeCompose RunType = "compose"
	RunTypeBinary  RunType = "binary"
)

func (*RunType) String

func (rt *RunType) String() string

type WithInit

type WithInit struct {
	// contains filtered or unexported fields
}

WithInit wraps a run-task to provide init functionality executed after the task started.

func (*WithInit) Done

func (rw *WithInit) Done() <-chan struct{}

func (*WithInit) Name

func (rw *WithInit) Name() string

func (*WithInit) Restart

func (rw *WithInit) Restart() (err error)

func (*WithInit) Running

func (rw *WithInit) Running() bool

func (*WithInit) Shutdown

func (rw *WithInit) Shutdown() (err error)

func (*WithInit) Start

func (rw *WithInit) Start() (err error)

func (*WithInit) Stderr

func (rw *WithInit) Stderr() io.Reader

func (*WithInit) Stdin

func (rw *WithInit) Stdin() io.Writer

func (*WithInit) Stdout

func (rw *WithInit) Stdout() io.Reader

func (*WithInit) Stop

func (rw *WithInit) Stop() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL