larker

package
v0.42.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLoadFailed           = errors.New("load failed")
	ErrExecFailed           = errors.New("exec failed")
	ErrMainFailed           = errors.New("failed to call main")
	ErrHookFailed           = errors.New("failed to call hook")
	ErrMainUnexpectedResult = errors.New("main returned unexpected result")
	ErrSanity               = errors.New("sanity check failed")
)
View Source
var ErrStarlarkConversion = errors.New("failed to convert Starlark data type")

Functions

This section is empty.

Types

type Context

type Context struct{}

func (*Context) Freeze

func (context *Context) Freeze()

func (*Context) Hash

func (context *Context) Hash() (uint32, error)

func (*Context) String

func (context *Context) String() string

func (*Context) Truth

func (context *Context) Truth() starlark.Bool

func (*Context) Type

func (context *Context) Type() string

type HookResult added in v0.36.0

type HookResult struct {
	ErrorMessage  string
	OutputLogs    []byte
	DurationNanos int64
	Result        interface{}
}

type Larker

type Larker struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Larker

func (*Larker) Hook added in v0.36.0

func (larker *Larker) Hook(
	ctx context.Context,
	source string,
	name string,
	arguments []interface{},
) (*HookResult, error)

func (*Larker) Main

func (larker *Larker) Main(ctx context.Context, source string) (string, error)

type Option

type Option func(*Larker)

func WithAffectedFiles added in v0.42.0

func WithAffectedFiles(affectedFiles []string) Option

func WithEnvironment added in v0.8.0

func WithEnvironment(env map[string]string) Option

func WithFileSystem

func WithFileSystem(fs fs.FileSystem) Option

Directories

Path Synopsis
fs
git

Jump to

Keyboard shortcuts

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