cli

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 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(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

func New(opts clients.CommonOpts) (pipeline.Client, error)

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.Walker) error

func (*Client) HandleEvents

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

func (*Client) PipelineWalkFunc

func (c *Client) PipelineWalkFunc(ctx context.Context, pipelines ...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(arg state.Argument) (bool, error)

func (*StateWrapper) GetBool added in v0.11.0

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

func (*StateWrapper) GetDirectory added in v0.11.0

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

func (*StateWrapper) GetDirectoryString added in v0.11.0

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

func (*StateWrapper) GetFile added in v0.11.0

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

func (*StateWrapper) GetFloat64 added in v0.11.0

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

func (*StateWrapper) GetInt64 added in v0.11.0

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

func (*StateWrapper) GetString added in v0.11.0

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

func (*StateWrapper) SetBool added in v0.11.0

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

func (*StateWrapper) SetDirectory added in v0.11.0

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

func (*StateWrapper) SetFile added in v0.11.0

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

func (*StateWrapper) SetFileReader added in v0.11.0

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

func (*StateWrapper) SetFloat64 added in v0.11.0

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

func (*StateWrapper) SetInt64 added in v0.11.0

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

func (*StateWrapper) SetString added in v0.11.0

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

Jump to

Keyboard shortcuts

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