Documentation ¶
Index ¶
- Constants
- func InitCache(c Cache)
- func LoadCacheModule() (starlark.StringDict, error)
- func LoadSecretModule() (starlark.StringDict, error)
- func LoadXPathModule() (starlark.StringDict, error)
- type Applet
- func (a *Applet) Call(callable *starlark.Function, args starlark.Tuple, ...) (val starlark.Value, err error)
- func (app *Applet) CallSchemaHandler(ctx context.Context, handlerName, parameter string) (result string, err error)
- func (app *Applet) GetSchema() string
- func (a *Applet) Load(filename string, src []byte, loader ModuleLoader) (err error)
- func (a *Applet) Run(config map[string]string, initializers ...ThreadInitializer) (roots []render.Root, err error)
- type AppletConfig
- func (a AppletConfig) Attr(name string) (starlark.Value, error)
- func (a AppletConfig) AttrNames() []string
- func (a AppletConfig) Freeze()
- func (a AppletConfig) Get(key starlark.Value) (starlark.Value, bool, error)
- func (a AppletConfig) Hash() (uint32, error)
- func (a AppletConfig) String() string
- func (a AppletConfig) Truth() starlark.Bool
- func (a AppletConfig) Type() string
- type Cache
- type InMemoryCache
- type InMemoryCacheRecord
- type ModuleLoader
- type SecretDecryptionKey
- type SecretEncryptionKey
- type ThreadInitializer
- type XPath
Constants ¶
const DefaultExpirationSeconds = 60
Variables ¶
This section is empty.
Functions ¶
func LoadCacheModule ¶
func LoadCacheModule() (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 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) 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.
type AppletConfig ¶ added in v0.12.0
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) 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 InMemoryCache ¶
type InMemoryCache struct {
// contains filtered or unexported fields
}
func NewInMemoryCache ¶
func NewInMemoryCache() *InMemoryCache
type InMemoryCacheRecord ¶
type InMemoryCacheRecord struct {
// contains filtered or unexported fields
}
type ModuleLoader ¶
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 ThreadInitializer ¶ added in v0.5.1
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.