cli

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KnownValues = map[state.Argument]func(context.Context, state.Writer) error{
	pipeline.ArgumentRemoteURL:  setCurrentRemote,
	pipeline.ArgumentCommitRef:  setCurrentCommit,
	pipeline.ArgumentBranch:     setCurrentBranch,
	pipeline.ArgumentWorkingDir: setWorkingDir,
	pipeline.ArgumentSourceFS:   setSourceFS,
	pipeline.ArgumentBuildID:    setBuildID,
}

KnownValues are URL values that we know how to retrieve using the command line.

Functions

func New

Types

type Client

type Client struct {
	Opts  clients.CommonOpts
	Log   *logrus.Logger
	State *StateWrapper
}

The Client is used when interacting with a scribe pipeline using the scribe CLI. It is used to run only one step. The CLI client simply runs the anonymous function defined in the step.

func (*Client) Done

func (c *Client) Done(ctx context.Context, w *pipeline.Collection) error

func (*Client) HandleEvents

func (c *Client) HandleEvents(events []pipeline.Event) error

func (*Client) HandlePipeline added in v0.12.0

func (c *Client) HandlePipeline(ctx context.Context, p pipeline.Pipeline) error

PipelineWalkFunc walks through the pipelines that the collection provides. Each pipeline is a pipeline of steps, so each will walk through the list of steps using the StepWalkFunc.

func (*Client) Validate

func (c *Client) Validate(step pipeline.Step) error

type StateWrapper added in v0.11.0

type StateWrapper struct {
	state.Reader
	state.Writer
	// contains filtered or unexported fields
}

func NewStateWrapper added in v0.11.0

func NewStateWrapper(r state.Reader, w state.Writer) *StateWrapper

func (*StateWrapper) Exists added in v0.11.0

func (w *StateWrapper) Exists(ctx context.Context, arg state.Argument) (bool, error)

func (*StateWrapper) GetBool added in v0.11.0

func (w *StateWrapper) GetBool(ctx context.Context, arg state.Argument) (bool, error)

func (*StateWrapper) GetDirectory added in v0.11.0

func (w *StateWrapper) GetDirectory(ctx context.Context, arg state.Argument) (fs.FS, error)

func (*StateWrapper) GetDirectoryString added in v0.11.0

func (w *StateWrapper) GetDirectoryString(ctx context.Context, arg state.Argument) (string, error)

func (*StateWrapper) GetFile added in v0.11.0

func (w *StateWrapper) GetFile(ctx context.Context, arg state.Argument) (*os.File, error)

func (*StateWrapper) GetFloat64 added in v0.11.0

func (w *StateWrapper) GetFloat64(ctx context.Context, arg state.Argument) (float64, error)

func (*StateWrapper) GetInt64 added in v0.11.0

func (w *StateWrapper) GetInt64(ctx context.Context, arg state.Argument) (int64, error)

func (*StateWrapper) GetString added in v0.11.0

func (w *StateWrapper) GetString(ctx context.Context, arg state.Argument) (string, error)

func (*StateWrapper) SetBool added in v0.11.0

func (w *StateWrapper) SetBool(ctx context.Context, key state.Argument, val bool) error

func (*StateWrapper) SetDirectory added in v0.11.0

func (w *StateWrapper) SetDirectory(ctx context.Context, key state.Argument, val string) error

func (*StateWrapper) SetFile added in v0.11.0

func (w *StateWrapper) SetFile(ctx context.Context, key state.Argument, val string) error

func (*StateWrapper) SetFileReader added in v0.11.0

func (w *StateWrapper) SetFileReader(ctx context.Context, key state.Argument, r io.Reader) (string, error)

func (*StateWrapper) SetFloat64 added in v0.11.0

func (w *StateWrapper) SetFloat64(ctx context.Context, key state.Argument, val float64) error

func (*StateWrapper) SetInt64 added in v0.11.0

func (w *StateWrapper) SetInt64(ctx context.Context, key state.Argument, val int64) error

func (*StateWrapper) SetString added in v0.11.0

func (w *StateWrapper) SetString(ctx context.Context, key state.Argument, val string) error

Jump to

Keyboard shortcuts

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