cli

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 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 StateHandler added in v0.13.0

type StateHandler struct{}

func (*StateHandler) SetBool added in v0.13.0

func (n *StateHandler) SetBool(ctx context.Context, arg state.Argument, val bool) error

func (*StateHandler) SetDirectory added in v0.13.0

func (n *StateHandler) SetDirectory(ctx context.Context, arg state.Argument, dir string) error

func (*StateHandler) SetFile added in v0.13.0

func (n *StateHandler) SetFile(ctx context.Context, arg state.Argument, path string) error

func (*StateHandler) SetFileReader added in v0.13.0

func (n *StateHandler) SetFileReader(ctx context.Context, arg state.Argument, r io.Reader) (string, error)

func (*StateHandler) SetFloat64 added in v0.13.0

func (n *StateHandler) SetFloat64(ctx context.Context, arg state.Argument, val float64) error

func (*StateHandler) SetInt64 added in v0.13.0

func (n *StateHandler) SetInt64(ctx context.Context, arg state.Argument, val int64) error

func (*StateHandler) SetString added in v0.13.0

func (n *StateHandler) SetString(ctx context.Context, arg state.Argument, val string) 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