luci: go.chromium.org/luci/lucicfg Index | Files | Directories

package lucicfg

import "go.chromium.org/luci/lucicfg"

Package lucicfg contains LUCI config generator.

Index

Package Files

configset.go errors.go genctx.go generator.go native.go protos.go state.go version.go

Constants

const (
    // Version is the version of lucicfg tool.
    //
    // It ends up in CLI output, in generated files and in User-Agent headers.
    Version = "0.1.0"

    // UserAgent is used for User-Agent header in HTTP requests from lucicfg.
    UserAgent = "lucicfg v" + Version
)

type BacktracableError Uses

type BacktracableError interface {
    error

    // Backtrace returns a user-friendly error message describing the stack
    // of calls that led to this error, along with the error message itself.
    Backtrace() string
}

BacktracableError is an error that has a starlark backtrace attached to it.

Implemented by Error here, by starlark.EvalError and graph errors.

type Error Uses

type Error struct {
    Msg   string
    Stack *builtins.CapturedStacktrace
}

Error is a single error message emitted by the config generator.

It holds a stack trace responsible for the error.

func (*Error) Backtrace Uses

func (e *Error) Backtrace() string

Backtrace is part of BacktracableError interface.

func (*Error) Error Uses

func (e *Error) Error() string

Error is part of 'error' interface.

type Inputs Uses

type Inputs struct {
    Code  interpreter.Loader // a package with the user supplied code
    Entry string             // a name of the entry point script in this package

    TextPBHeader string // a header to put into generated textpb files
    // contains filtered or unexported fields
}

Inputs define all inputs for the config generator.

type State Uses

type State struct {
    Inputs  Inputs            // all inputs, exactly as passed to Generate.
    Configs map[string]string // all generated config files, populated at the end
    // contains filtered or unexported fields
}

State is mutated throughout execution of the script and at the end contains the final execution result.

It is available in the implementation of native functions exposed to the Starlark side. Starlark code operates with the state exclusively through these functions.

func Generate Uses

func Generate(ctx context.Context, in Inputs) (*State, error)

Generate interprets the high-level config.

Returns a multi-error with all captured errors. Some of them may implement BacktracableError interface.

Directories

PathSynopsis
cliPackage cli contains command line interface for lucicfg tool.
graphPackage graph implements a DAG used internally to represent config objects.
starlarkPackage starlark is generated by go.chromium.org/luci/tools/cmd/assets.
testprotoPackage testproto contains proto messages used exclusively in unit tests.

Package lucicfg imports 18 packages (graph) and is imported by 1 packages. Updated 2018-12-14. Refresh now. Tools for package owners.