go: cuelang.org/go/internal/task Index | Files

package task

import "cuelang.org/go/internal/task"

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

Index

Package Files

task.go

func Register Uses

func Register(key string, f RunnerFunc)

Register registers a task for cue commands.

type Context Uses

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

A Context provides context for running a task.

type Runner Uses

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 Uses

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

A RunnerFunc creates a Runner.

func Lookup Uses

func Lookup(key string) RunnerFunc

Lookup returns the RunnerFunc for a key.

Package task imports 4 packages (graph) and is imported by 10 packages. Updated 2019-12-14. Refresh now. Tools for package owners.