task

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(key string, f RunnerFunc)

Register registers a task for cue commands.

Types

type Context

type Context struct {
	Context context.Context
	Stdout  io.Writer
	Stderr  io.Writer
}

A Context provides context for running a task.

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, v cue.Value) (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