Documentation
¶
Index ¶
- type ABIContext
- type BinaryModule
- type Closer
- type Context
- type ContextHandler
- type DataSource
- type FilterContext
- type HTTPRequest
- type HTTPResponse
- type HeaderMap
- type IoBuffer
- type JsonnableMap
- type ListenerDirection
- type Marshallable
- type MetricHandler
- type PropertyHolder
- type RuntimeCreatorStore
- type Stream
- type StreamHandler
- type StreamOption
- type VMKey
- type VMStore
- type WasmInstance
- type WasmInstanceContext
- type WasmModule
- type WasmPlugin
- type WasmPluginConfig
- type WasmPluginManager
- type WasmResult
- type WasmRuntime
- type WasmRuntimeCreator
- type WasmVM
- type WasmVMConfig
- type WrappedPropertyHolder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ABIContext ¶
type ABIContext = api.ABIContext
type BinaryModule ¶
type Context ¶
type Context interface {
PropertyHolder
ID() int32
NewContextID() int32
GetOrCreateContext(rootID string) Context
}
type ContextHandler ¶
type ContextHandler = api.ContextHandler
type DataSource ¶
type FilterContext ¶
type FilterContext interface {
api.ContextHandler
Logger() logr.Logger
Lock()
Unlock()
Close() error
ID() int32
RootContext() Context
GetABIContext() api.ContextHandler
}
type HTTPRequest ¶
type HTTPRequest interface {
URL() *url.URL
Header() HeaderMap
Trailer() HeaderMap
Body() io.ReadCloser
SetBody(io.ReadCloser)
HTTPProtocol() string
Host() string
Method() string
Connection() network.Connection
}
type HTTPResponse ¶
type HTTPResponse interface {
Header() HeaderMap
Trailer() HeaderMap
Body() io.ReadCloser
SetBody(io.ReadCloser)
Connection() network.Connection
ContentLength() int64
StatusCode() int
}
type JsonnableMap ¶
type JsonnableMap map[string]interface{}
func (JsonnableMap) Marshal ¶
func (m JsonnableMap) Marshal() ([]byte, error)
type ListenerDirection ¶
type ListenerDirection uint64
const ( ListenerDirectionUnspecified ListenerDirection = iota ListenerDirectionInbound ListenerDirectionOutbound )
type Marshallable ¶
type MetricHandler ¶
type PropertyHolder ¶
type RuntimeCreatorStore ¶
type RuntimeCreatorStore interface {
Get(name string) (WasmRuntimeCreator, bool)
Set(name string, creator WasmRuntimeCreator)
}
type Stream ¶
type Stream interface {
PropertyHolder
Logger() logr.Logger
Close() error
Direction() ListenerDirection
HandleHTTPRequest(req HTTPRequest) error
HandleHTTPResponse(resp HTTPResponse) error
HandleTCPNewConnection(conn net.Conn) error
HandleTCPCloseConnection(conn net.Conn) error
HandleDownstreamData(conn net.Conn, n int) error
HandleUpstreamData(conn net.Conn, n int) error
}
type StreamHandler ¶
type StreamHandler interface {
NewStream(direction ListenerDirection, options ...StreamOption) (Stream, error)
Logger() logr.Logger
}
type StreamOption ¶
type StreamOption func(instance interface{})
type VMStore ¶
type VMStore interface {
GetOrCreateVM(vmConfig WasmVMConfig) (WasmVM, error)
}
type WasmInstance ¶
type WasmInstance = api.WasmInstance
type WasmInstanceContext ¶
type WasmInstanceContext interface {
GetInstance() WasmInstance
GetProperties() PropertyHolder
GetABIContext() ContextHandler
}
type WasmModule ¶
type WasmModule = api.WasmModule
type WasmPlugin ¶
type WasmPlugin interface {
Name() string
ID() string
GetInstance() (WasmInstance, error)
ReleaseInstance(instance WasmInstance)
EnsureInstances(desired uint32) uint32
Exec(f func(instance WasmInstance) bool)
Close()
Report()
VM() WasmVM
Context() Context
Logger() logr.Logger
RegisterFilterContext(instance WasmInstance, filterContext FilterContext)
UnregisterFilterContext(instance WasmInstance, filterContext FilterContext)
GetFilterContext(instance WasmInstance, id int32) (FilterContext, bool)
GetWasmInstanceContext(instance WasmInstance) WasmInstanceContext
}
type WasmPluginConfig ¶
type WasmPluginConfig struct {
Name string `json:"name,omitempty"`
RootID string `json:"rootID,omitempty"`
VMConfig WasmVMConfig `json:"vmConfig,omitempty"`
Configuration Marshallable `json:"configuration,omitempty"`
InstanceCount uint32 `json:"instanceCount,omitempty"`
}
func (*WasmPluginConfig) Key ¶
func (c *WasmPluginConfig) Key() string
type WasmPluginManager ¶
type WasmPluginManager interface {
Delete(config WasmPluginConfig) error
Get(config WasmPluginConfig) (WasmPlugin, error)
GetOrCreate(config WasmPluginConfig) (WasmPlugin, error)
Add(config WasmPluginConfig) (WasmPlugin, error)
Logger() logr.Logger
GetBaseContext() Context
}
type WasmResult ¶
type WasmResult = api.WasmResult
type WasmRuntime ¶
type WasmRuntime interface {
Name() string
Init()
NewModule(wasmBytes []byte) (WasmModule, error)
}
type WasmRuntimeCreator ¶
type WasmRuntimeCreator func() WasmRuntime
type WasmVM ¶
type WasmVM interface {
WasmRuntime
Acquire(user interface{})
Release(user interface{})
Close()
}
type WasmVMConfig ¶
type WasmVMConfig struct {
ID string `json:"id,omitempty"`
Runtime string `json:"runtime,omitempty"`
Code DataSource `json:"code,omitempty"`
Configuration map[string]interface{} `json:"configuration,omitempty"`
}
func (*WasmVMConfig) GetVMKey ¶
func (c *WasmVMConfig) GetVMKey() (VMKey, error)
type WrappedPropertyHolder ¶
type WrappedPropertyHolder interface {
PropertyHolder
Properties() PropertyHolder
ParentProperties() PropertyHolder
}
Click to show internal directories.
Click to hide internal directories.