context

package
v0.9.13 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

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

Context carries values across function calls in a transformation

func NewContext

func NewContext(config, secrets map[string]interface{}) *Context

NewContext creates a new contex

func (*Context) GetConfig

func (c *Context) GetConfig(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)

GetConfig returns transformation configuration details TODO - supplying a string argument to qri.get_config('foo') should return the single config value instead of the whole map

func (*Context) GetSecret

func (c *Context) GetSecret(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)

GetSecret fetches a secret for a given string

func (*Context) SetResult

func (c *Context) SetResult(name string, value starlark.Value)

SetResult places the result of a function call in the results stringDict any results set here will be placed in the context struct field by name

func (*Context) Struct

func (c *Context) Struct() *starlarkstruct.Struct

Struct delivers this context as a starlark struct

Jump to

Keyboard shortcuts

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