Documentation
¶
Index ¶
- Constants
- func DecodeMap(rawData []byte) map[string]string
- func EncodeMap(m map[string]string) []byte
- func GetBuffer(instance *host.Instance, bufferType BufferType) *host.IoBuffer
- func GetMap(instance *host.Instance, mapType MapType) *host.HeaderMap
- func ProxyAddHeaderMapValue(instance *host.Instance, mapType int32, keyDataPtr int32, keySize int32, ...) int32
- func ProxyCallForeignFunction(instance *host.Instance, funcNamePtr int32, funcNameSize int32, paramPtr int32, ...) int32
- func ProxyCancelGrpcCall(instance *host.Instance, calloutID int32) int32
- func ProxyCloseGrpcCall(instance *host.Instance, calloutID int32) int32
- func ProxyDefineMetric(instance *host.Instance, metricType int32, namePtr int32, nameSize int32, ...) int32
- func ProxyDequeueSharedQueue(instance *host.Instance, token int32, dataPtr int32, dataSize int32) int32
- func ProxyDone(instance *host.Instance) int32
- func ProxyEnqueueSharedQueue(instance *host.Instance, token int32, dataPtr int32, dataSize int32) int32
- func ProxyGetBufferBytes(instance *host.Instance, bufferType int32, start int32, length int32, ...) int32
- func ProxyGetCurrentTimeNanoseconds(instance *host.Instance, resultUint64Ptr int32) int32
- func ProxyGetHeaderMapPairs(instance *host.Instance, mapType int32, returnDataPtr int32, ...) int32
- func ProxyGetHeaderMapValue(instance *host.Instance, mapType int32, keyDataPtr int32, keySize int32, ...) int32
- func ProxyGetMetric(instance *host.Instance, metricId int32, resultUint64Ptr int32) int32
- func ProxyGetProperty(instance *host.Instance, keyPtr int32, keySize int32, returnValueData int32, ...) int32
- func ProxyGetSharedData(instance *host.Instance, keyPtr int32, keySize int32, valuePtr int32, ...) int32
- func ProxyGrpcCall(instance *host.Instance, grpcServiceData int32, grpcServiceSize int32, ...) int32
- func ProxyHttpCall(instance *host.Instance, uriPtr int32, uriSize int32, headerPairsPtr int32, ...) int32
- func ProxyIncrementMetric(instance *host.Instance, metricId int32, offset int64) int32
- func ProxyLog(instance *host.Instance, level int32, logDataPtr int32, logDataSize int32) int32
- func ProxyOpenGrpcStream(instance *host.Instance, grpcServiceData int32, grpcServiceSize int32, ...) int32
- func ProxyRecordMetric(instance *host.Instance, metricId int32, value int64) int32
- func ProxyRegisterSharedQueue(instance *host.Instance, queueNamePtr int32, queueNameSize int32, ...) int32
- func ProxyRemoveHeaderMapValue(instance *host.Instance, mapType int32, keyDataPtr int32, keySize int32) int32
- func ProxyRemoveMetric(instance *host.Instance, metricID int32) int32
- func ProxyRemoveSharedQueue(instance *host.Instance, queueID int32) int32
- func ProxyReplaceHeaderMapValue(instance *host.Instance, mapType int32, keyDataPtr int32, keySize int32, ...) int32
- func ProxyResolveSharedQueue(instance *host.Instance, queueNamePtr int32, queueNameSize int32, ...) int32
- func ProxyResumeDownstream(instance *host.Instance) int32
- func ProxyResumeHttpRequest(instance *host.Instance) int32
- func ProxyResumeHttpResponse(instance *host.Instance) int32
- func ProxyResumeUpstream(instance *host.Instance) int32
- func ProxySendGrpcCallMessage(instance *host.Instance, calloutID int32, data int32, size int32, ...) int32
- func ProxySendHttpResponse(instance *host.Instance, respCode int32, respCodeDetailPtr int32, ...) int32
- func ProxySetBufferBytes(instance *host.Instance, bufferType int32, start int32, length int32, ...) int32
- func ProxySetEffectiveContext(instance *host.Instance, contextID int32) int32
- func ProxySetHeaderMapPairs(instance *host.Instance, mapType int32, ptr int32, size int32) int32
- func ProxySetProperty(instance *host.Instance, keyPtr int32, keySize int32, valuePtr int32, ...) int32
- func ProxySetSharedData(instance *host.Instance, keyPtr int32, keySize int32, valuePtr int32, ...) int32
- func ProxySetTickPeriodMilliseconds(instance *host.Instance, tickPeriodMilliseconds int32) int32
- func RegisterImports(instance *host.Instance)
- type ABIContext
- func (a *ABIContext) GetExports() Exports
- func (a *ABIContext) GetImports() ImportsHandler
- func (a *ABIContext) GetInstance() *host.Instance
- func (a *ABIContext) Name() string
- func (a *ABIContext) ProxyOnConfigure(rootContextId int32, configurationSize int32) (int32, error)
- func (a *ABIContext) ProxyOnContextCreate(contextId int32, parentContextId int32) error
- func (a *ABIContext) ProxyOnDelete(contextId int32) error
- func (a *ABIContext) ProxyOnDone(contextId int32) (int32, error)
- func (a *ABIContext) ProxyOnDownstreamConnectionClose(contextId int32, closeType int32) error
- func (a *ABIContext) ProxyOnDownstreamData(contextId int32, dataLength int32, endOfStream int32) (Action, error)
- func (a *ABIContext) ProxyOnGrpcCallClose(contextID int32, calloutID int32, statusCode int32) error
- func (a *ABIContext) ProxyOnGrpcCallResponseHeaderMetadata(contextID int32, calloutID int32, nElements int32) error
- func (a *ABIContext) ProxyOnGrpcCallResponseMessage(contextID int32, calloutID int32, msgSize int32) error
- func (a *ABIContext) ProxyOnGrpcCallResponseTrailerMetadata(contextID int32, calloutID int32, nElements int32) error
- func (a *ABIContext) ProxyOnHttpCallResponse(contextId int32, token int32, headers int32, bodySize int32, trailers int32) error
- func (a *ABIContext) ProxyOnLog(contextId int32) error
- func (a *ABIContext) ProxyOnMemoryAllocate(size int32) (int32, error)
- func (a *ABIContext) ProxyOnNewConnection(contextId int32) (Action, error)
- func (a *ABIContext) ProxyOnQueueReady(rootContextId int32, token int32) error
- func (a *ABIContext) ProxyOnRequestBody(contextId int32, bodyBufferLength int32, endOfStream int32) (Action, error)
- func (a *ABIContext) ProxyOnRequestHeaders(contextID int32, numHeaders int32, endOfStream int32) (Action, error)
- func (a *ABIContext) ProxyOnRequestMetadata(contextId int32, nElements int32) (Action, error)
- func (a *ABIContext) ProxyOnRequestTrailers(contextId int32, trailers int32) (Action, error)
- func (a *ABIContext) ProxyOnResponseBody(contextId int32, bodyBufferLength int32, endOfStream int32) (Action, error)
- func (a *ABIContext) ProxyOnResponseHeaders(contextId int32, headers int32, endOfStream int32) (Action, error)
- func (a *ABIContext) ProxyOnResponseMetadata(contextId int32, nElements int32) (Action, error)
- func (a *ABIContext) ProxyOnResponseTrailers(contextId int32, trailers int32) (Action, error)
- func (a *ABIContext) ProxyOnTick(rootContextId int32) error
- func (a *ABIContext) ProxyOnUpstreamConnectionClose(contextId int32, closeType int32) error
- func (a *ABIContext) ProxyOnUpstreamData(contextId int32, dataLength int32, endOfStream int32) (Action, error)
- func (a *ABIContext) ProxyOnVmStart(rootContextId int32, vmConfigurationSize int32) (int32, error)
- func (a *ABIContext) SetImports(imports ImportsHandler)
- func (a *ABIContext) SetInstance(instance *host.Instance)
- type Action
- type BufferType
- type ContextHandler
- type DefaultImportsHandler
- func (d *DefaultImportsHandler) CallForeignFunction(funcName string, param string) (string, WasmResult)
- func (d *DefaultImportsHandler) CancelGrpcCall(token int32) WasmResult
- func (d *DefaultImportsHandler) CloseGrpcCall(token int32) WasmResult
- func (d *DefaultImportsHandler) DefineMetric(metricType MetricType, name string) (int32, WasmResult)
- func (d *DefaultImportsHandler) DequeueSharedQueue(queueID uint32) (string, WasmResult)
- func (d *DefaultImportsHandler) Done() WasmResult
- func (d *DefaultImportsHandler) EnqueueSharedQueue(queueID uint32, data string) WasmResult
- func (d *DefaultImportsHandler) GetCurrentTimeNanoseconds() (int32, WasmResult)
- func (d *DefaultImportsHandler) GetCustomBuffer(bufferType BufferType) *host.IoBuffer
- func (d *DefaultImportsHandler) GetCustomHeader(mapType MapType) *host.HeaderMap
- func (d *DefaultImportsHandler) GetDownStreamData() *host.IoBuffer
- func (d *DefaultImportsHandler) GetFuncCallData() *host.IoBuffer
- func (d *DefaultImportsHandler) GetGrpcReceiveBuffer() *host.IoBuffer
- func (d *DefaultImportsHandler) GetGrpcReceiveInitialMetaData() *host.HeaderMap
- func (d *DefaultImportsHandler) GetGrpcReceiveTrailerMetaData() *host.HeaderMap
- func (d *DefaultImportsHandler) GetHttpCallResponseBody() *host.IoBuffer
- func (d *DefaultImportsHandler) GetHttpCallResponseHeaders() *host.HeaderMap
- func (d *DefaultImportsHandler) GetHttpCallResponseTrailer() *host.HeaderMap
- func (d *DefaultImportsHandler) GetHttpRequestBody() *host.IoBuffer
- func (d *DefaultImportsHandler) GetHttpRequestHeader() *host.HeaderMap
- func (d *DefaultImportsHandler) GetHttpRequestTrailer() *host.HeaderMap
- func (d *DefaultImportsHandler) GetHttpResponseBody() *host.IoBuffer
- func (d *DefaultImportsHandler) GetHttpResponseHeader() *host.HeaderMap
- func (d *DefaultImportsHandler) GetHttpResponseTrailer() *host.HeaderMap
- func (d *DefaultImportsHandler) GetMetric(metricID int32) (int64, WasmResult)
- func (d *DefaultImportsHandler) GetPluginConfig() *host.IoBuffer
- func (d *DefaultImportsHandler) GetProperty(key string) (string, WasmResult)
- func (d *DefaultImportsHandler) GetRootContextID() int32
- func (d *DefaultImportsHandler) GetSharedData(key string) (string, uint32, WasmResult)
- func (d *DefaultImportsHandler) GetUpstreamData() *host.IoBuffer
- func (d *DefaultImportsHandler) GetVmConfig() *host.IoBuffer
- func (d *DefaultImportsHandler) GrpcCall(grpcService string, serviceName string, method string, data *host.IoBuffer, ...) (int32, WasmResult)
- func (d *DefaultImportsHandler) HttpCall(url string, headers *host.HeaderMap, body *host.IoBuffer, ...) (int32, WasmResult)
- func (d *DefaultImportsHandler) IncrementMetric(metricID int32, offset int64) WasmResult
- func (d *DefaultImportsHandler) Log(level LogLevel, msg string) WasmResult
- func (d *DefaultImportsHandler) OpenGrpcStream(grpcService string, serviceName string, method string) (int32, WasmResult)
- func (d *DefaultImportsHandler) RecordMetric(metricID int32, value int64) WasmResult
- func (d *DefaultImportsHandler) RegisterSharedQueue(queueName string) (uint32, WasmResult)
- func (d *DefaultImportsHandler) RemoveMetric(metricID int32) WasmResult
- func (d *DefaultImportsHandler) RemoveSharedQueue(queueID uint32) WasmResult
- func (d *DefaultImportsHandler) ResolveSharedQueue(queueName string) (uint32, WasmResult)
- func (d *DefaultImportsHandler) ResumeDownstream() WasmResult
- func (d *DefaultImportsHandler) ResumeHttpRequest() WasmResult
- func (d *DefaultImportsHandler) ResumeHttpResponse() WasmResult
- func (d *DefaultImportsHandler) ResumeUpstream() WasmResult
- func (d *DefaultImportsHandler) SendGrpcCallMsg(token int32, data *host.IoBuffer, endOfStream int32) WasmResult
- func (d *DefaultImportsHandler) SendHttpResp(respCode int32, respCodeDetail *host.IoBuffer, respBody *host.IoBuffer, ...) WasmResult
- func (d *DefaultImportsHandler) SetEffectiveContextID(contextID int32) WasmResult
- func (d *DefaultImportsHandler) SetProperty(key string, value string) WasmResult
- func (d *DefaultImportsHandler) SetSharedData(key string, value string, cas uint32) WasmResult
- func (d *DefaultImportsHandler) SetTickPeriodMilliseconds(tickPeriodMilliseconds int32) WasmResult
- func (d *DefaultImportsHandler) Wait()
- type Exports
- type ImportsHandler
- type LogLevel
- type MapType
- type MetricType
- type WasmResult
Constants ¶
View Source
const ProxyWasmABI_0_1_0 string = "proxy_abi_version_0_1_0"
Variables ¶
This section is empty.
Functions ¶
func ProxyAddHeaderMapValue ¶
func ProxyDefineMetric ¶
func ProxyDequeueSharedQueue ¶
func ProxyEnqueueSharedQueue ¶
func ProxyGetBufferBytes ¶
func ProxyGetHeaderMapPairs ¶
func ProxyGetHeaderMapValue ¶
func ProxyGetMetric ¶
func ProxyGetProperty ¶
func ProxyGetSharedData ¶
func ProxyGrpcCall ¶
func ProxyHttpCall ¶
func ProxyIncrementMetric ¶
func ProxyOpenGrpcStream ¶
func ProxyRecordMetric ¶
func ProxyRemoveSharedQueue ¶
func ProxyResolveSharedQueue ¶
func ProxyResumeDownstream ¶
func ProxyResumeHttpRequest ¶
func ProxyResumeHttpResponse ¶
func ProxyResumeUpstream ¶
func ProxySendHttpResponse ¶
func ProxySetBufferBytes ¶
func ProxySetHeaderMapPairs ¶
func ProxySetProperty ¶
func ProxySetSharedData ¶
func RegisterImports ¶
Types ¶
type ABIContext ¶
type ABIContext struct { Imports ImportsHandler Instance *host.Instance }
func (*ABIContext) GetExports ¶
func (a *ABIContext) GetExports() Exports
func (*ABIContext) GetImports ¶
func (a *ABIContext) GetImports() ImportsHandler
func (*ABIContext) GetInstance ¶
func (a *ABIContext) GetInstance() *host.Instance
func (*ABIContext) Name ¶
func (a *ABIContext) Name() string
func (*ABIContext) ProxyOnConfigure ¶
func (a *ABIContext) ProxyOnConfigure(rootContextId int32, configurationSize int32) (int32, error)
func (*ABIContext) ProxyOnContextCreate ¶
func (a *ABIContext) ProxyOnContextCreate(contextId int32, parentContextId int32) error
func (*ABIContext) ProxyOnDelete ¶
func (a *ABIContext) ProxyOnDelete(contextId int32) error
func (*ABIContext) ProxyOnDone ¶
func (a *ABIContext) ProxyOnDone(contextId int32) (int32, error)
func (*ABIContext) ProxyOnDownstreamConnectionClose ¶
func (a *ABIContext) ProxyOnDownstreamConnectionClose(contextId int32, closeType int32) error
func (*ABIContext) ProxyOnDownstreamData ¶
func (*ABIContext) ProxyOnGrpcCallClose ¶
func (a *ABIContext) ProxyOnGrpcCallClose(contextID int32, calloutID int32, statusCode int32) error
func (*ABIContext) ProxyOnGrpcCallResponseHeaderMetadata ¶
func (a *ABIContext) ProxyOnGrpcCallResponseHeaderMetadata(contextID int32, calloutID int32, nElements int32) error
func (*ABIContext) ProxyOnGrpcCallResponseMessage ¶
func (a *ABIContext) ProxyOnGrpcCallResponseMessage(contextID int32, calloutID int32, msgSize int32) error
func (*ABIContext) ProxyOnGrpcCallResponseTrailerMetadata ¶
func (a *ABIContext) ProxyOnGrpcCallResponseTrailerMetadata(contextID int32, calloutID int32, nElements int32) error
func (*ABIContext) ProxyOnHttpCallResponse ¶
func (*ABIContext) ProxyOnLog ¶
func (a *ABIContext) ProxyOnLog(contextId int32) error
func (*ABIContext) ProxyOnMemoryAllocate ¶
func (a *ABIContext) ProxyOnMemoryAllocate(size int32) (int32, error)
func (*ABIContext) ProxyOnNewConnection ¶
func (a *ABIContext) ProxyOnNewConnection(contextId int32) (Action, error)
func (*ABIContext) ProxyOnQueueReady ¶
func (a *ABIContext) ProxyOnQueueReady(rootContextId int32, token int32) error
func (*ABIContext) ProxyOnRequestBody ¶
func (*ABIContext) ProxyOnRequestHeaders ¶
func (*ABIContext) ProxyOnRequestMetadata ¶
func (a *ABIContext) ProxyOnRequestMetadata(contextId int32, nElements int32) (Action, error)
func (*ABIContext) ProxyOnRequestTrailers ¶
func (a *ABIContext) ProxyOnRequestTrailers(contextId int32, trailers int32) (Action, error)
func (*ABIContext) ProxyOnResponseBody ¶
func (*ABIContext) ProxyOnResponseHeaders ¶
func (*ABIContext) ProxyOnResponseMetadata ¶
func (a *ABIContext) ProxyOnResponseMetadata(contextId int32, nElements int32) (Action, error)
func (*ABIContext) ProxyOnResponseTrailers ¶
func (a *ABIContext) ProxyOnResponseTrailers(contextId int32, trailers int32) (Action, error)
func (*ABIContext) ProxyOnTick ¶
func (a *ABIContext) ProxyOnTick(rootContextId int32) error
func (*ABIContext) ProxyOnUpstreamConnectionClose ¶
func (a *ABIContext) ProxyOnUpstreamConnectionClose(contextId int32, closeType int32) error
func (*ABIContext) ProxyOnUpstreamData ¶
func (*ABIContext) ProxyOnVmStart ¶
func (a *ABIContext) ProxyOnVmStart(rootContextId int32, vmConfigurationSize int32) (int32, error)
func (*ABIContext) SetImports ¶
func (a *ABIContext) SetImports(imports ImportsHandler)
func (*ABIContext) SetInstance ¶
func (a *ABIContext) SetInstance(instance *host.Instance)
type BufferType ¶
type BufferType int32
const ( BufferTypeHttpRequestBody BufferType = 0 BufferTypeHttpResponseBody BufferType = 1 BufferTypeDownstreamData BufferType = 2 BufferTypeUpstreamData BufferType = 3 BufferTypeHttpCallResponseBody BufferType = 4 BufferTypeGrpcReceiveBuffer BufferType = 5 BufferTypeVmConfiguration BufferType = 6 BufferTypePluginConfiguration BufferType = 7 BufferTypeCallData BufferType = 8 )
type ContextHandler ¶
type ContextHandler interface { Name() string GetImports() ImportsHandler SetImports(imports ImportsHandler) GetExports() Exports GetInstance() *host.Instance SetInstance(instance *host.Instance) }
type DefaultImportsHandler ¶
type DefaultImportsHandler struct{}
func (*DefaultImportsHandler) CallForeignFunction ¶
func (d *DefaultImportsHandler) CallForeignFunction(funcName string, param string) (string, WasmResult)
func (*DefaultImportsHandler) CancelGrpcCall ¶
func (d *DefaultImportsHandler) CancelGrpcCall(token int32) WasmResult
func (*DefaultImportsHandler) CloseGrpcCall ¶
func (d *DefaultImportsHandler) CloseGrpcCall(token int32) WasmResult
func (*DefaultImportsHandler) DefineMetric ¶
func (d *DefaultImportsHandler) DefineMetric(metricType MetricType, name string) (int32, WasmResult)
func (*DefaultImportsHandler) DequeueSharedQueue ¶
func (d *DefaultImportsHandler) DequeueSharedQueue(queueID uint32) (string, WasmResult)
func (*DefaultImportsHandler) Done ¶
func (d *DefaultImportsHandler) Done() WasmResult
func (*DefaultImportsHandler) EnqueueSharedQueue ¶
func (d *DefaultImportsHandler) EnqueueSharedQueue(queueID uint32, data string) WasmResult
func (*DefaultImportsHandler) GetCurrentTimeNanoseconds ¶
func (d *DefaultImportsHandler) GetCurrentTimeNanoseconds() (int32, WasmResult)
func (*DefaultImportsHandler) GetCustomBuffer ¶
func (d *DefaultImportsHandler) GetCustomBuffer(bufferType BufferType) *host.IoBuffer
func (*DefaultImportsHandler) GetCustomHeader ¶
func (d *DefaultImportsHandler) GetCustomHeader(mapType MapType) *host.HeaderMap
func (*DefaultImportsHandler) GetDownStreamData ¶
func (d *DefaultImportsHandler) GetDownStreamData() *host.IoBuffer
func (*DefaultImportsHandler) GetFuncCallData ¶
func (d *DefaultImportsHandler) GetFuncCallData() *host.IoBuffer
func (*DefaultImportsHandler) GetGrpcReceiveBuffer ¶
func (d *DefaultImportsHandler) GetGrpcReceiveBuffer() *host.IoBuffer
func (*DefaultImportsHandler) GetGrpcReceiveInitialMetaData ¶
func (d *DefaultImportsHandler) GetGrpcReceiveInitialMetaData() *host.HeaderMap
func (*DefaultImportsHandler) GetGrpcReceiveTrailerMetaData ¶
func (d *DefaultImportsHandler) GetGrpcReceiveTrailerMetaData() *host.HeaderMap
func (*DefaultImportsHandler) GetHttpCallResponseBody ¶
func (d *DefaultImportsHandler) GetHttpCallResponseBody() *host.IoBuffer
func (*DefaultImportsHandler) GetHttpCallResponseHeaders ¶
func (d *DefaultImportsHandler) GetHttpCallResponseHeaders() *host.HeaderMap
func (*DefaultImportsHandler) GetHttpCallResponseTrailer ¶
func (d *DefaultImportsHandler) GetHttpCallResponseTrailer() *host.HeaderMap
func (*DefaultImportsHandler) GetHttpRequestBody ¶
func (d *DefaultImportsHandler) GetHttpRequestBody() *host.IoBuffer
func (*DefaultImportsHandler) GetHttpRequestHeader ¶
func (d *DefaultImportsHandler) GetHttpRequestHeader() *host.HeaderMap
func (*DefaultImportsHandler) GetHttpRequestTrailer ¶
func (d *DefaultImportsHandler) GetHttpRequestTrailer() *host.HeaderMap
func (*DefaultImportsHandler) GetHttpResponseBody ¶
func (d *DefaultImportsHandler) GetHttpResponseBody() *host.IoBuffer
func (*DefaultImportsHandler) GetHttpResponseHeader ¶
func (d *DefaultImportsHandler) GetHttpResponseHeader() *host.HeaderMap
func (*DefaultImportsHandler) GetHttpResponseTrailer ¶
func (d *DefaultImportsHandler) GetHttpResponseTrailer() *host.HeaderMap
func (*DefaultImportsHandler) GetMetric ¶
func (d *DefaultImportsHandler) GetMetric(metricID int32) (int64, WasmResult)
func (*DefaultImportsHandler) GetPluginConfig ¶
func (d *DefaultImportsHandler) GetPluginConfig() *host.IoBuffer
func (*DefaultImportsHandler) GetProperty ¶
func (d *DefaultImportsHandler) GetProperty(key string) (string, WasmResult)
func (*DefaultImportsHandler) GetRootContextID ¶
func (d *DefaultImportsHandler) GetRootContextID() int32
utils
func (*DefaultImportsHandler) GetSharedData ¶
func (d *DefaultImportsHandler) GetSharedData(key string) (string, uint32, WasmResult)
func (*DefaultImportsHandler) GetUpstreamData ¶
func (d *DefaultImportsHandler) GetUpstreamData() *host.IoBuffer
func (*DefaultImportsHandler) GetVmConfig ¶
func (d *DefaultImportsHandler) GetVmConfig() *host.IoBuffer
func (*DefaultImportsHandler) GrpcCall ¶
func (d *DefaultImportsHandler) GrpcCall(grpcService string, serviceName string, method string, data *host.IoBuffer, timeoutMilliseconds int32) (int32, WasmResult)
func (*DefaultImportsHandler) IncrementMetric ¶
func (d *DefaultImportsHandler) IncrementMetric(metricID int32, offset int64) WasmResult
func (*DefaultImportsHandler) Log ¶
func (d *DefaultImportsHandler) Log(level LogLevel, msg string) WasmResult
func (*DefaultImportsHandler) OpenGrpcStream ¶
func (d *DefaultImportsHandler) OpenGrpcStream(grpcService string, serviceName string, method string) (int32, WasmResult)
func (*DefaultImportsHandler) RecordMetric ¶
func (d *DefaultImportsHandler) RecordMetric(metricID int32, value int64) WasmResult
func (*DefaultImportsHandler) RegisterSharedQueue ¶
func (d *DefaultImportsHandler) RegisterSharedQueue(queueName string) (uint32, WasmResult)
func (*DefaultImportsHandler) RemoveMetric ¶
func (d *DefaultImportsHandler) RemoveMetric(metricID int32) WasmResult
func (*DefaultImportsHandler) RemoveSharedQueue ¶
func (d *DefaultImportsHandler) RemoveSharedQueue(queueID uint32) WasmResult
func (*DefaultImportsHandler) ResolveSharedQueue ¶
func (d *DefaultImportsHandler) ResolveSharedQueue(queueName string) (uint32, WasmResult)
func (*DefaultImportsHandler) ResumeDownstream ¶
func (d *DefaultImportsHandler) ResumeDownstream() WasmResult
func (*DefaultImportsHandler) ResumeHttpRequest ¶
func (d *DefaultImportsHandler) ResumeHttpRequest() WasmResult
func (*DefaultImportsHandler) ResumeHttpResponse ¶
func (d *DefaultImportsHandler) ResumeHttpResponse() WasmResult
func (*DefaultImportsHandler) ResumeUpstream ¶
func (d *DefaultImportsHandler) ResumeUpstream() WasmResult
func (*DefaultImportsHandler) SendGrpcCallMsg ¶
func (d *DefaultImportsHandler) SendGrpcCallMsg(token int32, data *host.IoBuffer, endOfStream int32) WasmResult
func (*DefaultImportsHandler) SendHttpResp ¶
func (d *DefaultImportsHandler) SendHttpResp(respCode int32, respCodeDetail *host.IoBuffer, respBody *host.IoBuffer, additionalHeaderMap *host.HeaderMap, grpcCode int32) WasmResult
func (*DefaultImportsHandler) SetEffectiveContextID ¶
func (d *DefaultImportsHandler) SetEffectiveContextID(contextID int32) WasmResult
func (*DefaultImportsHandler) SetProperty ¶
func (d *DefaultImportsHandler) SetProperty(key string, value string) WasmResult
func (*DefaultImportsHandler) SetSharedData ¶
func (d *DefaultImportsHandler) SetSharedData(key string, value string, cas uint32) WasmResult
func (*DefaultImportsHandler) SetTickPeriodMilliseconds ¶
func (d *DefaultImportsHandler) SetTickPeriodMilliseconds(tickPeriodMilliseconds int32) WasmResult
func (*DefaultImportsHandler) Wait ¶
func (d *DefaultImportsHandler) Wait()
for golang host environment, no-op
type Exports ¶
type Exports interface { ProxyOnContextCreate(contextId int32, parentContextId int32) error ProxyOnDone(contextId int32) (int32, error) ProxyOnLog(contextId int32) error ProxyOnDelete(contextId int32) error ProxyOnMemoryAllocate(size int32) (int32, error) ProxyOnVmStart(rootContextId int32, vmConfigurationSize int32) (int32, error) ProxyOnConfigure(rootContextId int32, pluginConfigurationSize int32) (int32, error) ProxyOnTick(rootContextId int32) error ProxyOnNewConnection(contextId int32) (Action, error) ProxyOnDownstreamData(contextId int32, dataLength int32, endOfStream int32) (Action, error) ProxyOnDownstreamConnectionClose(contextId int32, closeType int32) error ProxyOnUpstreamData(contextId int32, dataLength int32, endOfStream int32) (Action, error) ProxyOnUpstreamConnectionClose(contextId int32, closeType int32) error ProxyOnRequestHeaders(contextId int32, headers int32, endOfStream int32) (Action, error) ProxyOnRequestBody(contextId int32, bodyBufferLength int32, endOfStream int32) (Action, error) ProxyOnRequestTrailers(contextId int32, trailers int32) (Action, error) ProxyOnRequestMetadata(contextId int32, nElements int32) (Action, error) ProxyOnResponseHeaders(contextId int32, headers int32, endOfStream int32) (Action, error) ProxyOnResponseBody(contextId int32, bodyBufferLength int32, endOfStream int32) (Action, error) ProxyOnResponseTrailers(contextId int32, trailers int32) (Action, error) ProxyOnResponseMetadata(contextId int32, nElements int32) (Action, error) ProxyOnHttpCallResponse(contextId int32, token int32, headers int32, bodySize int32, trailers int32) error ProxyOnQueueReady(rootContextId int32, token int32) error ProxyOnGrpcCallResponseHeaderMetadata(contextID int32, calloutID int32, nElements int32) error ProxyOnGrpcCallResponseMessage(contextID int32, calloutID int32, msgSize int32) error ProxyOnGrpcCallResponseTrailerMetadata(contextID int32, calloutID int32, nElements int32) error ProxyOnGrpcCallClose(contextID int32, calloutID int32, statusCode int32) error }
Exports contains ABI that exported by wasm module.
type ImportsHandler ¶
type ImportsHandler interface { // utils Log(level LogLevel, msg string) WasmResult GetRootContextID() int32 SetEffectiveContextID(contextID int32) WasmResult SetTickPeriodMilliseconds(tickPeriodMilliseconds int32) WasmResult GetCurrentTimeNanoseconds() (int32, WasmResult) Done() WasmResult // config GetVmConfig() *host.IoBuffer GetPluginConfig() *host.IoBuffer // metric DefineMetric(metricType MetricType, name string) (int32, WasmResult) IncrementMetric(metricID int32, offset int64) WasmResult RecordMetric(metricID int32, value int64) WasmResult GetMetric(metricID int32) (int64, WasmResult) RemoveMetric(metricID int32) WasmResult // property GetProperty(key string) (string, WasmResult) SetProperty(key string, value string) WasmResult // l4 GetDownStreamData() *host.IoBuffer GetUpstreamData() *host.IoBuffer ResumeDownstream() WasmResult ResumeUpstream() WasmResult // http GetHttpRequestHeader() *host.HeaderMap GetHttpRequestBody() *host.IoBuffer GetHttpRequestTrailer() *host.HeaderMap GetHttpResponseHeader() *host.HeaderMap GetHttpResponseBody() *host.IoBuffer GetHttpResponseTrailer() *host.HeaderMap HttpCall(url string, headers *host.HeaderMap, body *host.IoBuffer, trailer *host.HeaderMap, timeoutMilliseconds int32) (int32, WasmResult) GetHttpCallResponseHeaders() *host.HeaderMap GetHttpCallResponseBody() *host.IoBuffer GetHttpCallResponseTrailer() *host.HeaderMap ResumeHttpRequest() WasmResult ResumeHttpResponse() WasmResult SendHttpResp(respCode int32, respCodeDetail *host.IoBuffer, respBody *host.IoBuffer, additionalHeaderMap *host.HeaderMap, grpcCode int32) WasmResult // grpc OpenGrpcStream(grpcService string, serviceName string, method string) (int32, WasmResult) SendGrpcCallMsg(token int32, data *host.IoBuffer, endOfStream int32) WasmResult CancelGrpcCall(token int32) WasmResult CloseGrpcCall(token int32) WasmResult GrpcCall(grpcService string, serviceName string, method string, data *host.IoBuffer, timeoutMilliseconds int32) (int32, WasmResult) GetGrpcReceiveInitialMetaData() *host.HeaderMap GetGrpcReceiveBuffer() *host.IoBuffer GetGrpcReceiveTrailerMetaData() *host.HeaderMap // foreign CallForeignFunction(funcName string, param string) (string, WasmResult) GetFuncCallData() *host.IoBuffer // shared // for golang host environment // Wait until async call return, eg. sync http call in golang Wait() // custom extension GetCustomBuffer(bufferType BufferType) *host.IoBuffer GetCustomHeader(mapType MapType) *host.HeaderMap }
type MapType ¶
type MapType int32
const ( MapTypeHttpRequestHeaders MapType = 0 MapTypeHttpRequestTrailers MapType = 1 MapTypeHttpResponseHeaders MapType = 2 MapTypeHttpResponseTrailers MapType = 3 MapTypeGrpcReceiveInitialMetadata MapType = 4 MapTypeGrpcReceiveTrailingMetadata MapType = 5 MapTypeHttpCallResponseHeaders MapType = 6 MapTypeHttpCallResponseTrailers MapType = 7 )
type MetricType ¶
type MetricType int32
const ( MetricTypeCounter MetricType = 0 MetricTypeGauge MetricType = 1 MetricTypeHistogram MetricType = 2 MetricTypeMax MetricType = 2 )
type WasmResult ¶
type WasmResult int32
const ( WasmResultOk WasmResult = 0 WasmResultNotFound WasmResult = 1 // The result could not be found, e.g. a provided key did not appear in a table. WasmResultBadArgument WasmResult = 2 // An argument was bad, e.g. did not not conform to the required range. WasmResultSerializationFailure WasmResult = 3 // A protobuf could not be serialized. WasmResultParseFailure WasmResult = 4 // A protobuf could not be parsed. WasmResultBadExpression WasmResult = 5 // A provided expression (e.g. "foo.bar") was illegal or unrecognized. WasmResultInvalidMemoryAccess WasmResult = 6 // A provided memory range was not legal. WasmResultEmpty WasmResult = 7 // Data was requested from an empty container. WasmResultCasMismatch WasmResult = 8 // The provided CAS did not match that of the stored data. WasmResultResultMismatch WasmResult = 9 // Returned result was unexpected, e.g. of the incorrect size. WasmResultInternalFailure WasmResult = 10 // Internal failure: trying check logs of the surrounding system. WasmResultBrokenConnection WasmResult = 11 // The connection/stream/pipe was broken/closed unexpectedly. WasmResultUnimplemented WasmResult = 12 // Feature not implemented. )
func (WasmResult) Int32 ¶
func (wasmResult WasmResult) Int32() int32
Click to show internal directories.
Click to hide internal directories.