Documentation
¶
Index ¶
- func ConvertEachValue(value any) ([]any, error)
- func ConvertRisorValueToBool(obj object.Object) bool
- func ConvertRisorValueToGo(obj object.Object) any
- func ConvertValueToBool(value any) bool
- func DefaultRisorGlobals() map[string]any
- func GetSafeGlobals() map[string]bool
- type Compiler
- type RisorScript
- type RisorScriptingEngine
- type RisorValue
- type Script
- type Template
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertEachValue ¶
ConvertEachValue converts any value to an array of values for use in each blocks This works with both Risor objects and plain Go values for extensibility
func ConvertRisorValueToBool ¶
ConvertRisorValueToBool converts a Risor object to a boolean indicating truthiness
func ConvertRisorValueToGo ¶
ConvertRisorValueToGo converts a Risor object to a Go value
func ConvertValueToBool ¶
ConvertValueToBool converts any value to a boolean indicating truthiness This works with both Risor objects and plain Go values for extensibility
func DefaultRisorGlobals ¶
func GetSafeGlobals ¶
GetSafeGlobals returns a map of Risor built-in function names that are safe to use in workflows due to being deterministic with no side effects.
Types ¶
type RisorScript ¶
type RisorScript struct {
// contains filtered or unexported fields
}
type RisorScriptingEngine ¶
type RisorScriptingEngine struct {
// contains filtered or unexported fields
}
func NewRisorScriptingEngine ¶
func NewRisorScriptingEngine(globals map[string]any) *RisorScriptingEngine
type RisorValue ¶
type RisorValue struct {
// contains filtered or unexported fields
}
func (*RisorValue) IsTruthy ¶
func (value *RisorValue) IsTruthy() bool
func (*RisorValue) Items ¶
func (value *RisorValue) Items() ([]any, error)
func (*RisorValue) String ¶
func (value *RisorValue) String() string
func (*RisorValue) Value ¶
func (value *RisorValue) Value() any
type Value ¶
type Value interface {
// Value returns the Go value for this value as an any
Value() any
// Items returns the items for this value as an array of any
Items() ([]any, error)
// String returns the string representation of this value
String() string
// IsTruthy returns true if this value is truthy
IsTruthy() bool
}
Value represents the result of a script evaluation.
Click to show internal directories.
Click to hide internal directories.