larker

package
v0.117.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMalformedKeyValueTuple = errors.New("malformed key-value tuple")
	ErrNotADictOrTuple        = errors.New("main() should return a list of either dicts or tuples")
	ErrMixedList              = errors.New("main() should return a list of either dicts or tuples, " +
		"found both types in a single list")
)
View Source
var (
	ErrLoadFailed           = errors.New("load failed")
	ErrNotFound             = errors.New("entrypoint not found")
	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 ErrExecFailed

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

func (*ErrExecFailed) Error added in v0.53.0

func (eee *ErrExecFailed) Error() string

func (*ErrExecFailed) Unwrap added in v0.53.0

func (eee *ErrExecFailed) Unwrap() error

type ExtendedError added in v0.53.0

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

func (*ExtendedError) Error added in v0.53.0

func (ee *ExtendedError) Error() string

func (*ExtendedError) Is added in v0.54.0

func (ee *ExtendedError) Is(err error) bool

func (*ExtendedError) Logs added in v0.53.0

func (ee *ExtendedError) Logs() []byte

func (*ExtendedError) Unwrap added in v0.53.0

func (ee *ExtendedError) Unwrap() error

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) (*MainResult, error)

func (*Larker) MainOptional added in v0.54.0

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

type MainResult added in v0.42.6

type MainResult struct {
	OutputLogs []byte
	YAMLConfig string
}

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

func WithTestMode added in v0.53.0

func WithTestMode() Option

Jump to

Keyboard shortcuts

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