v0.9.1 Latest Latest

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

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 8 Imported by: 0



Package task provides a registry for tasks to be used by commands.



This section is empty.


This section is empty.


func Register

func Register(key string, f RunnerFunc)

Register registers a task for cue commands.


type Context

type Context struct {
	Context context.Context

	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
	Obj    cue.Value
	Err    errors.Error

A Context provides context for running a task.

func (*Context) Bytes added in v0.1.0

func (c *Context) Bytes(field string) []byte

func (*Context) Int64 added in v0.1.0

func (c *Context) Int64(field string) int64

func (*Context) Lookup added in v0.1.0

func (c *Context) Lookup(field string) cue.Value

func (*Context) String added in v0.1.0

func (c *Context) String(field string) string

type Runner

type Runner interface {

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

A Runner defines a command type.

type RunnerFunc

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

A RunnerFunc creates a Runner.

func Lookup

func Lookup(key string) RunnerFunc

Lookup returns the RunnerFunc for a key.

Jump to

Keyboard shortcuts

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