Documentation ¶
Index ¶
- func RunAndWait(rt *goja.Runtime, fn goja.Callable, args ...goja.Value) error
- func RunAndWaitForResult(rt *goja.Runtime, fn goja.Callable, args ...goja.Value) (res goja.Value, err error)
- func SetupModuleEventLoop(printer console.Printer, rtCtx modules.RuntimeContext, ...) error
- type ErrorHandlerFunc
- type FetchUpstreamUrlFunc
- type NoopPrinter
- type RequestHandlerFunc
- type RequestModifierFunc
- type ResponseModifierFunc
- type Results
- type RuntimeOptions
- type TrackerEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunAndWait ¶ added in v0.8.0
func RunAndWaitForResult ¶
func RunAndWaitForResult( rt *goja.Runtime, fn goja.Callable, args ...goja.Value, ) (res goja.Value, err error)
RunAndWaitForResult can execute a goja function and wait for the result if the result is a promise, it will wait for the promise to resolve
func SetupModuleEventLoop ¶ added in v0.8.0
Types ¶
type ErrorHandlerFunc ¶
type ErrorHandlerFunc func(*types.ModuleContext, error) error
func DefaultErrorHandlerFunction ¶
func DefaultErrorHandlerFunction() ErrorHandlerFunc
func ExtractErrorHandlerFunction ¶
func ExtractErrorHandlerFunction( loop *eventloop.EventLoop, ) (errorHandler ErrorHandlerFunc, err error)
type FetchUpstreamUrlFunc ¶
type FetchUpstreamUrlFunc func(*types.ModuleContext) (*url.URL, error)
this can be used to create custom load balancing strategies, by default it uses round robin
func DefaultFetchUpstreamFunction ¶
func DefaultFetchUpstreamFunction() FetchUpstreamUrlFunc
func ExtractFetchUpstreamFunction ¶
func ExtractFetchUpstreamFunction( loop *eventloop.EventLoop, ) (fetchUpstream FetchUpstreamUrlFunc, err error)
type NoopPrinter ¶
type NoopPrinter struct{}
func (*NoopPrinter) Error ¶
func (p *NoopPrinter) Error(string)
func (*NoopPrinter) Log ¶
func (p *NoopPrinter) Log(string)
func (*NoopPrinter) Warn ¶
func (p *NoopPrinter) Warn(string)
type RequestHandlerFunc ¶
type RequestHandlerFunc func(*types.ModuleContext) error
func ExtractRequestHandlerFunction ¶
func ExtractRequestHandlerFunction( loop *eventloop.EventLoop, ) (requestHandler RequestHandlerFunc, err error)
type RequestModifierFunc ¶
type RequestModifierFunc func(*types.ModuleContext) error
func ExtractRequestModifierFunction ¶
func ExtractRequestModifierFunction( loop *eventloop.EventLoop, ) (requestModifier RequestModifierFunc, err error)
type ResponseModifierFunc ¶
type ResponseModifierFunc func(*types.ModuleContext, *http.Response) error
func ExtractResponseModifierFunction ¶
func ExtractResponseModifierFunction( loop *eventloop.EventLoop, ) (responseModifier ResponseModifierFunc, err error)
type RuntimeOptions ¶
Click to show internal directories.
Click to hide internal directories.