registry

package
v1.6.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTasks

func GetTasks() map[string]Task

func RegisterRunner added in v0.3.1

func RegisterRunner(key string, f RunnerFunc)

RegisterRunner registers a task for cue commands.

func RegisterTask

func RegisterTask(name string, task Task)

RegisterTask register task for appfile

func Run

func Run(spec map[string]interface{}, io util.IOStreams) (map[string]interface{}, error)

Run executes tasks Deprecated: Run is deprecated, you should use DoTasks is builtin package, it will automatically register all internal functions

Types

type CallCtx

type CallCtx interface {
	LookUp(...string) (interface{}, error)
	IO() util.IOStreams
}

CallCtx is task handle context

type Meta added in v0.3.1

type Meta struct {
	Context context.Context
	Stdin   io.Reader
	Stdout  io.Writer
	Stderr  io.Writer
	Obj     cue.Value
	Err     error
}

Meta provides context for running a task.

func (*Meta) Bytes added in v0.3.1

func (m *Meta) Bytes(field string) []byte

Bytes fetch the value formatted bytes of context by filed

func (*Meta) Int64 added in v0.3.1

func (m *Meta) Int64(field string) int64

Int64 fetch the value formatted int64 of context by filed

func (*Meta) Lookup added in v0.3.1

func (m *Meta) Lookup(field string) cue.Value

Lookup fetches the value of context by filed

func (*Meta) String added in v0.3.1

func (m *Meta) String(field string) string

String fetch the value formatted string of context by filed

type Runner added in v0.3.1

type Runner interface {

	// Runner runs given the current value and returns a new value which is to
	// be unified with the original result.
	Run(meta *Meta) (results interface{}, err error)
}

Runner defines a command type.

type RunnerFunc added in v0.3.1

type RunnerFunc func(v cue.Value) (Runner, error)

RunnerFunc creates a Runner.

func LookupRunner added in v0.3.1

func LookupRunner(key string) RunnerFunc

LookupRunner returns the RunnerFunc for a key.

type Task

type Task func(ctx CallCtx, params interface{}) error

Task process app-file

Jump to

Keyboard shortcuts

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