runtime

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: Apache-2.0 Imports: 36 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultExpirationSeconds = 60
View Source
const (
	ModuleName = "render"
)

Variables

This section is empty.

Functions

func InitCache

func InitCache(c Cache)

func LoadCacheModule

func LoadCacheModule() (starlark.StringDict, error)

func LoadModule

func LoadModule() (starlark.StringDict, error)

func LoadSecretModule added in v0.13.2

func LoadSecretModule() (starlark.StringDict, error)

func LoadXPathModule added in v0.4.3

func LoadXPathModule() (starlark.StringDict, error)

Types

type AnimatedPositioned

type AnimatedPositioned struct {
	Widget
	animation.AnimatedPositioned
}

func (AnimatedPositioned) AsRenderWidget

func (ap AnimatedPositioned) AsRenderWidget() render.Widget

func (AnimatedPositioned) Attr

func (ap AnimatedPositioned) Attr(name string) (starlark.Value, error)

func (AnimatedPositioned) AttrNames

func (ap AnimatedPositioned) AttrNames() []string

func (AnimatedPositioned) Freeze

func (ap AnimatedPositioned) Freeze()

func (AnimatedPositioned) Hash

func (ap AnimatedPositioned) Hash() (uint32, error)

func (AnimatedPositioned) String

func (ap AnimatedPositioned) String() string

func (AnimatedPositioned) Truth

func (ap AnimatedPositioned) Truth() starlark.Bool

func (AnimatedPositioned) Type

func (ap AnimatedPositioned) Type() string

type Animation

type Animation struct {
	Widget
	render.Animation
	// contains filtered or unexported fields
}

func (*Animation) AsRenderWidget

func (w *Animation) AsRenderWidget() render.Widget

func (*Animation) Attr

func (w *Animation) Attr(name string) (starlark.Value, error)

func (*Animation) AttrNames

func (w *Animation) AttrNames() []string

func (*Animation) Freeze

func (w *Animation) Freeze()

func (*Animation) Hash

func (w *Animation) Hash() (uint32, error)

func (*Animation) String

func (w *Animation) String() string

func (*Animation) Truth

func (w *Animation) Truth() starlark.Bool

func (*Animation) Type

func (w *Animation) Type() string

type Applet

type Applet struct {
	Filename            string
	Id                  string
	Globals             starlark.StringDict
	SecretDecryptionKey *SecretDecryptionKey
	// contains filtered or unexported fields
}

func (*Applet) Call

func (a *Applet) Call(callable *starlark.Function, args starlark.Tuple, initializers ...ThreadInitializer) (val starlark.Value, err error)

Calls any callable from Applet.Globals. Pass args and receive a starlark Value, or an error if you're unlucky.

func (*Applet) CallSchemaHandler added in v0.10.0

func (app *Applet) CallSchemaHandler(ctx context.Context, handlerName, parameter string) (result string, err error)

CallSchemaHandler calls a schema handler, passing it a single string parameter and returning a single string value.

func (*Applet) GetSchema added in v0.10.0

func (app *Applet) GetSchema() string

GetSchema returns the config for the applet.

func (*Applet) Load

func (a *Applet) Load(filename string, src []byte, loader ModuleLoader) (err error)

Loads an applet. The script filename is used as a descriptor only, and the actual code should be passed in src. Optionally also pass loader to make additional starlark modules available to the script.

func (*Applet) Run

func (a *Applet) Run(config map[string]string, initializers ...ThreadInitializer) (roots []render.Root, err error)

Runs the applet's main function, passing it configuration as a starlark dict.

type AppletConfig added in v0.12.0

type AppletConfig map[string]string

func (AppletConfig) Attr added in v0.12.0

func (a AppletConfig) Attr(name string) (starlark.Value, error)

func (AppletConfig) AttrNames added in v0.12.0

func (a AppletConfig) AttrNames() []string

func (AppletConfig) Freeze added in v0.12.0

func (a AppletConfig) Freeze()

func (AppletConfig) Get added in v0.12.0

func (AppletConfig) Hash added in v0.12.0

func (a AppletConfig) Hash() (uint32, error)

func (AppletConfig) String added in v0.12.0

func (a AppletConfig) String() string

func (AppletConfig) Truth added in v0.12.0

func (a AppletConfig) Truth() starlark.Bool

func (AppletConfig) Type added in v0.12.0

func (a AppletConfig) Type() string

type Box

type Box struct {
	Widget
	render.Box
	// contains filtered or unexported fields
}

func (*Box) AsRenderWidget

func (w *Box) AsRenderWidget() render.Widget

func (*Box) Attr

func (w *Box) Attr(name string) (starlark.Value, error)

func (*Box) AttrNames

func (w *Box) AttrNames() []string

func (*Box) Freeze

func (w *Box) Freeze()

func (*Box) Hash

func (w *Box) Hash() (uint32, error)

func (*Box) String

func (w *Box) String() string

func (*Box) Truth

func (w *Box) Truth() starlark.Bool

func (*Box) Type

func (w *Box) Type() string

type Cache

type Cache interface {
	Set(thread *starlark.Thread, key string, value []byte, ttl int64) error
	Get(thread *starlark.Thread, key string) ([]byte, bool, error)
}

type Circle

type Circle struct {
	Widget
	render.Circle
	// contains filtered or unexported fields
}

func (*Circle) AsRenderWidget

func (w *Circle) AsRenderWidget() render.Widget

func (*Circle) Attr

func (w *Circle) Attr(name string) (starlark.Value, error)

func (*Circle) AttrNames

func (w *Circle) AttrNames() []string

func (*Circle) Freeze

func (w *Circle) Freeze()

func (*Circle) Hash

func (w *Circle) Hash() (uint32, error)

func (*Circle) String

func (w *Circle) String() string

func (*Circle) Truth

func (w *Circle) Truth() starlark.Bool

func (*Circle) Type

func (w *Circle) Type() string

type Column

type Column struct {
	Widget
	render.Column
	// contains filtered or unexported fields
}

func (*Column) AsRenderWidget

func (w *Column) AsRenderWidget() render.Widget

func (*Column) Attr

func (w *Column) Attr(name string) (starlark.Value, error)

func (*Column) AttrNames

func (w *Column) AttrNames() []string

func (*Column) Freeze

func (w *Column) Freeze()

func (*Column) Hash

func (w *Column) Hash() (uint32, error)

func (*Column) String

func (w *Column) String() string

func (*Column) Truth

func (w *Column) Truth() starlark.Bool

func (*Column) Type

func (w *Column) Type() string

type Image

type Image struct {
	Widget
	render.Image
	// contains filtered or unexported fields
}

func (*Image) AsRenderWidget

func (w *Image) AsRenderWidget() render.Widget

func (*Image) Attr

func (w *Image) Attr(name string) (starlark.Value, error)

func (*Image) AttrNames

func (w *Image) AttrNames() []string

func (*Image) Freeze

func (w *Image) Freeze()

func (*Image) Hash

func (w *Image) Hash() (uint32, error)

func (*Image) String

func (w *Image) String() string

func (*Image) Truth

func (w *Image) Truth() starlark.Bool

func (*Image) Type

func (w *Image) Type() string

type InMemoryCache

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

func NewInMemoryCache

func NewInMemoryCache() *InMemoryCache

func (*InMemoryCache) Get

func (c *InMemoryCache) Get(_ *starlark.Thread, key string) (value []byte, found bool, err error)

func (*InMemoryCache) Set

func (c *InMemoryCache) Set(_ *starlark.Thread, key string, value []byte, ttl int64) error

type InMemoryCacheRecord

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

type Marquee

type Marquee struct {
	Widget
	render.Marquee
	// contains filtered or unexported fields
}

func (*Marquee) AsRenderWidget

func (w *Marquee) AsRenderWidget() render.Widget

func (*Marquee) Attr

func (w *Marquee) Attr(name string) (starlark.Value, error)

func (*Marquee) AttrNames

func (w *Marquee) AttrNames() []string

func (*Marquee) Freeze

func (w *Marquee) Freeze()

func (*Marquee) Hash

func (w *Marquee) Hash() (uint32, error)

func (*Marquee) String

func (w *Marquee) String() string

func (*Marquee) Truth

func (w *Marquee) Truth() starlark.Bool

func (*Marquee) Type

func (w *Marquee) Type() string

type ModuleLoader

type ModuleLoader func(*starlark.Thread, string) (starlark.StringDict, error)

type Padding

type Padding struct {
	Widget
	render.Padding
	// contains filtered or unexported fields
}

func (*Padding) AsRenderWidget

func (w *Padding) AsRenderWidget() render.Widget

func (*Padding) Attr

func (w *Padding) Attr(name string) (starlark.Value, error)

func (*Padding) AttrNames

func (w *Padding) AttrNames() []string

func (*Padding) Freeze

func (w *Padding) Freeze()

func (*Padding) Hash

func (w *Padding) Hash() (uint32, error)

func (*Padding) String

func (w *Padding) String() string

func (*Padding) Truth

func (w *Padding) Truth() starlark.Bool

func (*Padding) Type

func (w *Padding) Type() string

type Plot

type Plot struct {
	Widget
	render.Plot
	// contains filtered or unexported fields
}

func (Plot) AsRenderWidget

func (p Plot) AsRenderWidget() render.Widget

func (Plot) Attr

func (p Plot) Attr(name string) (starlark.Value, error)

func (Plot) AttrNames

func (p Plot) AttrNames() []string

func (Plot) Freeze

func (p Plot) Freeze()

func (Plot) Hash

func (p Plot) Hash() (uint32, error)

func (Plot) String

func (p Plot) String() string

func (Plot) Truth

func (p Plot) Truth() starlark.Bool

func (Plot) Type

func (p Plot) Type() string

type Root

type Root struct {
	render.Root
	// contains filtered or unexported fields
}

func (Root) AsRenderRoot

func (r Root) AsRenderRoot() render.Root

func (Root) Attr

func (r Root) Attr(name string) (starlark.Value, error)

func (Root) AttrNames

func (r Root) AttrNames() []string

func (Root) Freeze

func (r Root) Freeze()

func (Root) Hash

func (r Root) Hash() (uint32, error)

func (Root) String

func (r Root) String() string

func (Root) Truth

func (r Root) Truth() starlark.Bool

func (Root) Type

func (r Root) Type() string

type Row

type Row struct {
	Widget
	render.Row
	// contains filtered or unexported fields
}

func (*Row) AsRenderWidget

func (w *Row) AsRenderWidget() render.Widget

func (*Row) Attr

func (w *Row) Attr(name string) (starlark.Value, error)

func (*Row) AttrNames

func (w *Row) AttrNames() []string

func (*Row) Freeze

func (w *Row) Freeze()

func (*Row) Hash

func (w *Row) Hash() (uint32, error)

func (*Row) String

func (w *Row) String() string

func (*Row) Truth

func (w *Row) Truth() starlark.Bool

func (*Row) Type

func (w *Row) Type() string

type SecretDecryptionKey added in v0.13.0

type SecretDecryptionKey struct {
	// EncryptedKeysetJSON is the encrypted JSON representation of a Tink keyset.
	EncryptedKeysetJSON []byte

	// KeyEncryptionKey is a Tink key that can be used to decrypt the keyset.
	KeyEncryptionKey tink.AEAD
}

SecretDecryptionKey is a key that can be used to decrypt secrets.

type SecretEncryptionKey added in v0.13.0

type SecretEncryptionKey struct {
	// PublicKeysetJSON is the serialized JSON representation of a Tink keyset.
	PublicKeysetJSON []byte
}

SecretEncryptionKey is a key that can be used to encrypt secrets, but not decrypt them.

func (*SecretEncryptionKey) Encrypt added in v0.13.0

func (sek *SecretEncryptionKey) Encrypt(appName, plaintext string) (string, error)

Encrypt encrypts a value for use as a secret in an app. Provide both a value and the name of the app the encrypted secret will be used in. The value will only be usable with the specified app.

type Stack

type Stack struct {
	Widget
	render.Stack
	// contains filtered or unexported fields
}

func (*Stack) AsRenderWidget

func (w *Stack) AsRenderWidget() render.Widget

func (*Stack) Attr

func (w *Stack) Attr(name string) (starlark.Value, error)

func (*Stack) AttrNames

func (w *Stack) AttrNames() []string

func (*Stack) Freeze

func (w *Stack) Freeze()

func (*Stack) Hash

func (w *Stack) Hash() (uint32, error)

func (*Stack) String

func (w *Stack) String() string

func (*Stack) Truth

func (w *Stack) Truth() starlark.Bool

func (*Stack) Type

func (w *Stack) Type() string

type Text

type Text struct {
	Widget
	render.Text
	// contains filtered or unexported fields
}

func (*Text) AsRenderWidget

func (w *Text) AsRenderWidget() render.Widget

func (*Text) Attr

func (w *Text) Attr(name string) (starlark.Value, error)

func (*Text) AttrNames

func (w *Text) AttrNames() []string

func (*Text) Freeze

func (w *Text) Freeze()

func (*Text) Hash

func (w *Text) Hash() (uint32, error)

func (*Text) String

func (w *Text) String() string

func (*Text) Truth

func (w *Text) Truth() starlark.Bool

func (*Text) Type

func (w *Text) Type() string

type ThreadInitializer added in v0.5.1

type ThreadInitializer func(thread *starlark.Thread) *starlark.Thread

ThreadInitializer is called when building a Starlark thread to run an applet on. It can customize the thread by overriding behavior or attaching thread local data.

type Widget

type Widget interface {
	AsRenderWidget() render.Widget
}

type WrappedText

type WrappedText struct {
	Widget
	render.WrappedText
	// contains filtered or unexported fields
}

func (*WrappedText) AsRenderWidget

func (w *WrappedText) AsRenderWidget() render.Widget

func (*WrappedText) Attr

func (w *WrappedText) Attr(name string) (starlark.Value, error)

func (*WrappedText) AttrNames

func (w *WrappedText) AttrNames() []string

func (*WrappedText) Freeze

func (w *WrappedText) Freeze()

func (*WrappedText) Hash

func (w *WrappedText) Hash() (uint32, error)

func (*WrappedText) String

func (w *WrappedText) String() string

func (*WrappedText) Truth

func (w *WrappedText) Truth() starlark.Bool

func (*WrappedText) Type

func (w *WrappedText) Type() string

type XPath added in v0.4.3

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

func (*XPath) Attr added in v0.4.3

func (x *XPath) Attr(name string) (starlark.Value, error)

func (*XPath) AttrNames added in v0.4.3

func (x *XPath) AttrNames() []string

func (*XPath) Freeze added in v0.4.3

func (x *XPath) Freeze()

func (*XPath) Hash added in v0.4.3

func (x *XPath) Hash() (uint32, error)

func (*XPath) String added in v0.4.3

func (x *XPath) String() string

func (*XPath) Truth added in v0.4.3

func (x *XPath) Truth() starlark.Bool

func (*XPath) Type added in v0.4.3

func (x *XPath) Type() string

Directories

Path Synopsis
modules

Jump to

Keyboard shortcuts

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