starlarkutil

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ThreadContextKey is the name of the Starlark thread-local that we use to
	// pass context around.
	ThreadContextKey = "tidbyt.dev/pixlet/starlarkutil/$ctx"
)

Variables

This section is empty.

Functions

func AttachThreadContext

func AttachThreadContext(ctx context.Context, thread *starlark.Thread)

AttachThreadContext attaches context to a Starlark thread so that it can be retrieved latter with `ThreadContext`.

func ThreadContext

func ThreadContext(thread *starlark.Thread) context.Context

ThreadContext returns the context that was attached to a Starlark thread by `AttachThreadContext`. If no context is attached to the thread, it returns a new, empty context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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