api

package
v0.6.0-rc8 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithRequest

func ContextWithRequest(ctx context.Context, req *request.CoordinatedRequest) context.Context

ContextWithRequest returns the provided context with a request object added as a value

func RequestFromContext

func RequestFromContext(ctx context.Context) *request.CoordinatedRequest

RequestFromContext returns the stored request from a given context, if any

Types

type HostAPI

type HostAPI interface {
	HostFunctions() []HostFn
}

func New

func New(log zerolog.Logger) HostAPI

New returns the default engine API with the default config (everything enabled)

func NewWithConfig

func NewWithConfig(log zerolog.Logger, config capabilities.CapabilityConfig) (HostAPI, error)

NewWithConfig returns the default engine API with the given config

type HostFn

type HostFn struct {
	Name     string
	ArgCount int
	Returns  bool
	HostFn   innerFunc
}

HostFn describes a host function callable from within a module module

func NewHostFn

func NewHostFn(name string, argCount int, returns bool, fn innerFunc) HostFn

NewHostFn creates a new host function

Jump to

Keyboard shortcuts

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