script

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(
	next string,
	scripts map[string]*configV1.ConfigObject,
	annotations []*configV1.Annotation,
	execute func(*configV1.ConfigObject, easyjson.RawMessage) (easyjson.RawMessage, error),
	wait func(),
) error

Run runs the script with key scriptId in the given scripts map.

Depending on the id in the Next field of the return value any other script in the map may be executed sequentially.

The script arguments are compiled from current script annotations, seed annotations and the contents of the data object returned by the previously executed script (if any). Seed annotations has higher precedence than script annotations and the data field from the return value have highest precedence.

Types

type ReturnValue

type ReturnValue struct {
	// WaitForData specifies whether or not one should wait for
	// network activity to settle after script execution.
	WaitForData bool `json:"waitForData,omitempty"`
	// Next specifies the ID of a script to be executed next.
	Next string `json:"next,omitempty"`
	// Data specifies arguments to a potential next script.
	Data easyjson.RawMessage `json:"data,omitempty"`
}

ReturnValue is the return value format for scripts of type ON_LOAD, ON_NEW_DOCUMENT and UNDEFINED.

func (ReturnValue) String

func (rv ReturnValue) String() string

String implements the Stringer interface

Jump to

Keyboard shortcuts

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