Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Call ¶ added in v0.14.0
func Call( ctx context.Context, main *compiler.Code, functionName string, args []object.Object, options ...Option, ) (object.Object, error)
Call evaluates the precompiled code and then calls the named function. The supplied arguments are passed in the function call. The result of the function call is returned.
Types ¶
type Option ¶
type Option func(*cfg.RisorConfig)
Option describes a function used to configure a Risor evaluation.
func WithGlobal ¶ added in v0.14.0
WithGlobal supplies a single named global variable to the Risor evaluation.
func WithGlobals ¶ added in v0.14.0
WithGlobals provides global variables that are made available to Risor evaluations. This option is additive, so multiple WithGlobals options may be supplied. If the same key is supplied multiple times, the last supplied value is used.
func WithImporter ¶
WithImporter supplies an Importer that will be used to execute import statements.
func WithLocalImporter ¶ added in v0.8.0
WithLocalImporter enables importing Risor modules from the given directory.
func WithoutDefaultGlobals ¶ added in v0.14.0
func WithoutDefaultGlobals() Option
WithoutDefaultGlobals opts out of all default global builtins and modules.
Directories ¶
Path | Synopsis |
---|---|
Package ast defines the abstract syntax tree representation of Risor code.
|
Package ast defines the abstract syntax tree representation of Risor code. |
Package builtins defines a default set of built-in functions.
|
Package builtins defines a default set of built-in functions. |
cmd
|
|
risor
Module
|
|
risor-api
Module
|
|
risor-docs
Module
|
|
risor-lsp
Module
|
|
risor-modgen
Module
|
|
Package compiler is used to compile a Risor abstract syntax tree (AST) into the corresponding bytecode.
|
Package compiler is used to compile a Risor abstract syntax tree (AST) into the corresponding bytecode. |
Package errz defines a FriendlyError interface for errors that have a human friendly message in addition to the default error message.
|
Package errz defines a FriendlyError interface for errors that have a human friendly message in addition to the default error message. |
examples
|
|
go/struct
Module
|
|
Package importer provides a common interface used to import Risor modules.
|
Package importer provides a common interface used to import Risor modules. |
internal
|
|
tmpl
Package tmpl is used to parse Risor string templates.
|
Package tmpl is used to parse Risor string templates. |
Package lexer provides a Lexer that takes Risor source code as input and outputs a stream of tokens to be consumed by a parser.
|
Package lexer provides a Lexer that takes Risor source code as input and outputs a stream of tokens to be consumed by a parser. |
Package limits provides an interface and helpers for restricting resource usage during Risor evaluations.
|
Package limits provides an interface and helpers for restricting resource usage during Risor evaluations. |
modules
|
|
aws
Module
|
|
bcrypt
Module
|
|
carbon
Module
|
|
cli
Module
|
|
gha
Module
|
|
image
Module
|
|
jmespath
Module
|
|
kubernetes
Module
|
|
pgx
Module
|
|
sql
Module
|
|
template
Module
|
|
uuid
Module
|
|
vault
Module
|
|
Package object provides the standard set of Risor object types.
|
Package object provides the standard set of Risor object types. |
Package op defines opcodes used by the Risor compiler and virtual machine.
|
Package op defines opcodes used by the Risor compiler and virtual machine. |
s3fs
Module
|
|
Package parser is used to generate the abstract syntax tree (AST) for a program.
|
Package parser is used to generate the abstract syntax tree (AST) for a program. |
tests
|
|
Package token defines language keywords and tokens used when lexing source code.
|
Package token defines language keywords and tokens used when lexing source code. |
Package vm provides a VirtualMachine that executes compiled Risor code.
|
Package vm provides a VirtualMachine that executes compiled Risor code. |