internal

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricTypeCounter   = 0
	MetricTypeGauge     = 1
	MetricTypeHistogram = 2
)

Variables

This section is empty.

Functions

func DeserializeMap

func DeserializeMap(bs []byte) [][2]string

func ProxyOnConfigure

func ProxyOnConfigure(pluginContextID uint32, vmConfigurationSize int) types.OnPluginStartStatus

func ProxyOnContextCreate

func ProxyOnContextCreate(contextID uint32, pluginContextID uint32)

func ProxyOnDelete

func ProxyOnDelete(contextID uint32)

func ProxyOnDone

func ProxyOnDone(contextID uint32) bool

func ProxyOnDownstreamConnectionClose

func ProxyOnDownstreamConnectionClose(contextID uint32, pType types.PeerType)

func ProxyOnDownstreamData

func ProxyOnDownstreamData(contextID uint32, dataSize int, endOfStream bool) types.Action

func ProxyOnHttpCallResponse

func ProxyOnHttpCallResponse(pluginContextID, calloutID uint32, numHeaders, bodySize, numTrailers int)

func ProxyOnLog

func ProxyOnLog(pluginContextID uint32)

func ProxyOnNewConnection

func ProxyOnNewConnection(contextID uint32) types.Action

func ProxyOnQueueReady

func ProxyOnQueueReady(contextID, queueID uint32)

func ProxyOnRequestBody

func ProxyOnRequestBody(contextID uint32, bodySize int, endOfStream bool) types.Action

func ProxyOnRequestHeaders

func ProxyOnRequestHeaders(contextID uint32, numHeaders int, endOfStream bool) types.Action

func ProxyOnRequestTrailers

func ProxyOnRequestTrailers(contextID uint32, numTrailers int) types.Action

func ProxyOnResponseBody

func ProxyOnResponseBody(contextID uint32, bodySize int, endOfStream bool) types.Action

func ProxyOnResponseHeaders

func ProxyOnResponseHeaders(contextID uint32, numHeaders int, endOfStream bool) types.Action

func ProxyOnResponseTrailers

func ProxyOnResponseTrailers(contextID uint32, numTrailers int) types.Action

func ProxyOnTick

func ProxyOnTick(pluginContextID uint32)

func ProxyOnUpstreamConnectionClose

func ProxyOnUpstreamConnectionClose(contextID uint32, pType types.PeerType)

func ProxyOnUpstreamData

func ProxyOnUpstreamData(contextID uint32, dataSize int, endOfStream bool) types.Action

func ProxyOnVMStart

func ProxyOnVMStart(pluginContextID uint32, vmConfigurationSize int) types.OnVMStartStatus

func RawBytePtrToByteSlice

func RawBytePtrToByteSlice(raw *byte, size int) []byte

func RawBytePtrToString

func RawBytePtrToString(raw *byte, size int) string

func RegisterHttpCallout

func RegisterHttpCallout(calloutID uint32, callback func(numHeaders, bodySize, numTrailers int))

func RegisterMockWasmHost

func RegisterMockWasmHost(host ProxyWasmHost) (release func())

func RegisterRedisCallout

func RegisterRedisCallout(calloutID uint32, callback func(status, responseSize int))

func SerializeMap

func SerializeMap(ms [][2]string) []byte

func SerializePropertyPath

func SerializePropertyPath(path []string) []byte

func SetVMContext

func SetVMContext(vmContext types.VMContext)

func StatusToError

func StatusToError(status Status) error

func StringBytePtr

func StringBytePtr(msg string) *byte

func VMStateGetActiveContextID

func VMStateGetActiveContextID() uint32

func VMStateReset

func VMStateReset()

func VMStateSetActiveContextID

func VMStateSetActiveContextID(contextID uint32)

Types

type BufferType

type BufferType uint32
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
	BufferTypeRedisCallResponse    BufferType = 9
)

type DefaultProxyWAMSHost

type DefaultProxyWAMSHost struct{}

func (DefaultProxyWAMSHost) ProxyAddHeaderMapValue

func (d DefaultProxyWAMSHost) ProxyAddHeaderMapValue(mapType MapType, keyData *byte, keySize int, valueData *byte, valueSize int) Status

func (DefaultProxyWAMSHost) ProxyCallForeignFunction

func (d DefaultProxyWAMSHost) ProxyCallForeignFunction(funcNamePtr *byte, funcNameSize int, paramPtr *byte, paramSize int, returnData **byte, returnSize *int) Status

func (DefaultProxyWAMSHost) ProxyCloseStream

func (d DefaultProxyWAMSHost) ProxyCloseStream(streamType StreamType) Status

func (DefaultProxyWAMSHost) ProxyContinueStream

func (d DefaultProxyWAMSHost) ProxyContinueStream(streamType StreamType) Status

func (DefaultProxyWAMSHost) ProxyDefineMetric

func (d DefaultProxyWAMSHost) ProxyDefineMetric(metricType MetricType, metricNameData *byte, metricNameSize int, returnMetricIDPtr *uint32) Status

func (DefaultProxyWAMSHost) ProxyDequeueSharedQueue

func (d DefaultProxyWAMSHost) ProxyDequeueSharedQueue(queueID uint32, returnValueData **byte, returnValueSize *int) Status

func (DefaultProxyWAMSHost) ProxyDone

func (d DefaultProxyWAMSHost) ProxyDone() Status

func (DefaultProxyWAMSHost) ProxyEnqueueSharedQueue

func (d DefaultProxyWAMSHost) ProxyEnqueueSharedQueue(queueID uint32, valueData *byte, valueSize int) Status

func (DefaultProxyWAMSHost) ProxyGetBufferBytes

func (d DefaultProxyWAMSHost) ProxyGetBufferBytes(bufferType BufferType, start int, maxSize int, returnBufferData **byte, returnBufferSize *int) Status

func (DefaultProxyWAMSHost) ProxyGetHeaderMapPairs

func (d DefaultProxyWAMSHost) ProxyGetHeaderMapPairs(mapType MapType, returnValueData **byte, returnValueSize *int) Status

func (DefaultProxyWAMSHost) ProxyGetHeaderMapValue

func (d DefaultProxyWAMSHost) ProxyGetHeaderMapValue(mapType MapType, keyData *byte, keySize int, returnValueData **byte, returnValueSize *int) Status

func (DefaultProxyWAMSHost) ProxyGetMetric

func (d DefaultProxyWAMSHost) ProxyGetMetric(metricID uint32, returnMetricValue *uint64) Status

func (DefaultProxyWAMSHost) ProxyGetProperty

func (d DefaultProxyWAMSHost) ProxyGetProperty(pathData *byte, pathSize int, returnValueData **byte, returnValueSize *int) Status

func (DefaultProxyWAMSHost) ProxyGetSharedData

func (d DefaultProxyWAMSHost) ProxyGetSharedData(keyData *byte, keySize int, returnValueData **byte, returnValueSize *int, returnCas *uint32) Status

func (DefaultProxyWAMSHost) ProxyHttpCall

func (d DefaultProxyWAMSHost) ProxyHttpCall(upstreamData *byte, upstreamSize int, headerData *byte, headerSize int, bodyData *byte, bodySize int, trailersData *byte, trailersSize int, timeout uint32, calloutIDPtr *uint32) Status

func (DefaultProxyWAMSHost) ProxyIncrementMetric

func (d DefaultProxyWAMSHost) ProxyIncrementMetric(metricID uint32, offset int64) Status

func (DefaultProxyWAMSHost) ProxyLog

func (d DefaultProxyWAMSHost) ProxyLog(logLevel LogLevel, messageData *byte, messageSize int) Status

func (DefaultProxyWAMSHost) ProxyRecordMetric

func (d DefaultProxyWAMSHost) ProxyRecordMetric(metricID uint32, value uint64) Status

func (DefaultProxyWAMSHost) ProxyRedisCall

func (d DefaultProxyWAMSHost) ProxyRedisCall(upstreamData *byte, upstreamSize int, queryData *byte, querySize int, calloutIDPtr *uint32) Status

func (DefaultProxyWAMSHost) ProxyRedisInit

func (d DefaultProxyWAMSHost) ProxyRedisInit(upstreamData *byte, upstreamSize int, usernameData *byte, usernameSize int, passwordData *byte, passwordSize int, timeout uint32) Status

func (DefaultProxyWAMSHost) ProxyRegisterSharedQueue

func (d DefaultProxyWAMSHost) ProxyRegisterSharedQueue(nameData *byte, nameSize int, returnID *uint32) Status

func (DefaultProxyWAMSHost) ProxyRemoveHeaderMapValue

func (d DefaultProxyWAMSHost) ProxyRemoveHeaderMapValue(mapType MapType, keyData *byte, keySize int) Status

func (DefaultProxyWAMSHost) ProxyReplaceHeaderMapValue

func (d DefaultProxyWAMSHost) ProxyReplaceHeaderMapValue(mapType MapType, keyData *byte, keySize int, valueData *byte, valueSize int) Status

func (DefaultProxyWAMSHost) ProxyResolveSharedQueue

func (d DefaultProxyWAMSHost) ProxyResolveSharedQueue(vmIDData *byte, vmIDSize int, nameData *byte, nameSize int, returnID *uint32) Status

func (DefaultProxyWAMSHost) ProxySendLocalResponse

func (d DefaultProxyWAMSHost) ProxySendLocalResponse(statusCode uint32, statusCodeDetailData *byte, statusCodeDetailsSize int, bodyData *byte, bodySize int, headersData *byte, headersSize int, grpcStatus int32) Status

func (DefaultProxyWAMSHost) ProxySetBufferBytes

func (d DefaultProxyWAMSHost) ProxySetBufferBytes(bufferType BufferType, start int, maxSize int, bufferData *byte, bufferSize int) Status

func (DefaultProxyWAMSHost) ProxySetEffectiveContext

func (d DefaultProxyWAMSHost) ProxySetEffectiveContext(contextID uint32) Status

func (DefaultProxyWAMSHost) ProxySetHeaderMapPairs

func (d DefaultProxyWAMSHost) ProxySetHeaderMapPairs(mapType MapType, mapData *byte, mapSize int) Status

func (DefaultProxyWAMSHost) ProxySetProperty

func (d DefaultProxyWAMSHost) ProxySetProperty(pathData *byte, pathSize int, valueData *byte, valueSize int) Status

func (DefaultProxyWAMSHost) ProxySetSharedData

func (d DefaultProxyWAMSHost) ProxySetSharedData(keyData *byte, keySize int, valueData *byte, valueSize int, cas uint32) Status

func (DefaultProxyWAMSHost) ProxySetTickPeriodMilliseconds

func (d DefaultProxyWAMSHost) ProxySetTickPeriodMilliseconds(period uint32) Status

type LogLevel

type LogLevel uint32
const (
	LogLevelTrace    LogLevel = 0
	LogLevelDebug    LogLevel = 1
	LogLevelInfo     LogLevel = 2
	LogLevelWarn     LogLevel = 3
	LogLevelError    LogLevel = 4
	LogLevelCritical LogLevel = 5
	LogLevelMax      LogLevel = 6
)

func (LogLevel) String

func (l LogLevel) String() string

type MapType

type MapType uint32
const (
	MapTypeHttpRequestHeaders       MapType = 0
	MapTypeHttpRequestTrailers      MapType = 1
	MapTypeHttpResponseHeaders      MapType = 2
	MapTypeHttpResponseTrailers     MapType = 3
	MapTypeHttpCallResponseHeaders  MapType = 6
	MapTypeHttpCallResponseTrailers MapType = 7
)

type MetricType

type MetricType uint32

type ProxyWasmHost

type ProxyWasmHost interface {
	ProxyLog(logLevel LogLevel, messageData *byte, messageSize int) Status
	ProxySetProperty(pathData *byte, pathSize int, valueData *byte, valueSize int) Status
	ProxyGetProperty(pathData *byte, pathSize int, returnValueData **byte, returnValueSize *int) Status
	ProxySendLocalResponse(statusCode uint32, statusCodeDetailData *byte, statusCodeDetailsSize int, bodyData *byte, bodySize int, headersData *byte, headersSize int, grpcStatus int32) Status
	ProxyGetSharedData(keyData *byte, keySize int, returnValueData **byte, returnValueSize *int, returnCas *uint32) Status
	ProxySetSharedData(keyData *byte, keySize int, valueData *byte, valueSize int, cas uint32) Status
	ProxyRegisterSharedQueue(nameData *byte, nameSize int, returnID *uint32) Status
	ProxyResolveSharedQueue(vmIDData *byte, vmIDSize int, nameData *byte, nameSize int, returnID *uint32) Status
	ProxyDequeueSharedQueue(queueID uint32, returnValueData **byte, returnValueSize *int) Status
	ProxyEnqueueSharedQueue(queueID uint32, valueData *byte, valueSize int) Status
	ProxyGetHeaderMapValue(mapType MapType, keyData *byte, keySize int, returnValueData **byte, returnValueSize *int) Status
	ProxyAddHeaderMapValue(mapType MapType, keyData *byte, keySize int, valueData *byte, valueSize int) Status
	ProxyReplaceHeaderMapValue(mapType MapType, keyData *byte, keySize int, valueData *byte, valueSize int) Status
	ProxyContinueStream(streamType StreamType) Status
	ProxyCloseStream(streamType StreamType) Status
	ProxyRemoveHeaderMapValue(mapType MapType, keyData *byte, keySize int) Status
	ProxyGetHeaderMapPairs(mapType MapType, returnValueData **byte, returnValueSize *int) Status
	ProxySetHeaderMapPairs(mapType MapType, mapData *byte, mapSize int) Status
	ProxyGetBufferBytes(bufferType BufferType, start int, maxSize int, returnBufferData **byte, returnBufferSize *int) Status
	ProxySetBufferBytes(bufferType BufferType, start int, maxSize int, bufferData *byte, bufferSize int) Status
	ProxyHttpCall(upstreamData *byte, upstreamSize int, headerData *byte, headerSize int, bodyData *byte, bodySize int, trailersData *byte, trailersSize int, timeout uint32, calloutIDPtr *uint32) Status
	ProxyRedisInit(upstreamData *byte, upstreamSize int, usernameData *byte, usernameSize int, passwordData *byte, passwordSize int, timeout uint32) Status
	ProxyRedisCall(upstreamData *byte, upstreamSize int, queryData *byte, querySize int, calloutIDPtr *uint32) Status
	ProxyCallForeignFunction(funcNamePtr *byte, funcNameSize int, paramPtr *byte, paramSize int, returnData **byte, returnSize *int) Status
	ProxySetTickPeriodMilliseconds(period uint32) Status
	ProxySetEffectiveContext(contextID uint32) Status
	ProxyDone() Status
	ProxyDefineMetric(metricType MetricType, metricNameData *byte, metricNameSize int, returnMetricIDPtr *uint32) Status
	ProxyIncrementMetric(metricID uint32, offset int64) Status
	ProxyRecordMetric(metricID uint32, value uint64) Status
	ProxyGetMetric(metricID uint32, returnMetricValue *uint64) Status
}

type Status

type Status uint32
const (
	StatusOK              Status = 0
	StatusNotFound        Status = 1
	StatusBadArgument     Status = 2
	StatusEmpty           Status = 7
	StatusCasMismatch     Status = 8
	StatusInternalFailure Status = 10
	StatusUnimplemented   Status = 12
)

func ProxyAddHeaderMapValue

func ProxyAddHeaderMapValue(mapType MapType, keyData *byte, keySize int, valueData *byte, valueSize int) Status

func ProxyCallForeignFunction

func ProxyCallForeignFunction(funcNamePtr *byte, funcNameSize int, paramPtr *byte, paramSize int, returnData **byte, returnSize *int) Status

func ProxyCloseStream

func ProxyCloseStream(streamType StreamType) Status

func ProxyContinueStream

func ProxyContinueStream(streamType StreamType) Status

func ProxyDefineMetric

func ProxyDefineMetric(metricType MetricType,
	metricNameData *byte, metricNameSize int, returnMetricIDPtr *uint32) Status

func ProxyDequeueSharedQueue

func ProxyDequeueSharedQueue(queueID uint32, returnValueData **byte, returnValueSize *int) Status

func ProxyDone

func ProxyDone() Status

func ProxyEnqueueSharedQueue

func ProxyEnqueueSharedQueue(queueID uint32, valueData *byte, valueSize int) Status

func ProxyGetBufferBytes

func ProxyGetBufferBytes(bufferType BufferType, start int, maxSize int, returnBufferData **byte, returnBufferSize *int) Status

func ProxyGetHeaderMapPairs

func ProxyGetHeaderMapPairs(mapType MapType, returnValueData **byte, returnValueSize *int) Status

func ProxyGetHeaderMapValue

func ProxyGetHeaderMapValue(mapType MapType, keyData *byte, keySize int, returnValueData **byte, returnValueSize *int) Status

func ProxyGetMetric

func ProxyGetMetric(metricID uint32, returnMetricValue *uint64) Status

func ProxyGetProperty

func ProxyGetProperty(pathData *byte, pathSize int, returnValueData **byte, returnValueSize *int) Status

func ProxyGetSharedData

func ProxyGetSharedData(keyData *byte, keySize int, returnValueData **byte, returnValueSize *int, returnCas *uint32) Status

func ProxyHttpCall

func ProxyHttpCall(upstreamData *byte, upstreamSize int, headerData *byte, headerSize int, bodyData *byte,
	bodySize int, trailersData *byte, trailersSize int, timeout uint32, calloutIDPtr *uint32) Status

func ProxyIncrementMetric

func ProxyIncrementMetric(metricID uint32, offset int64) Status

func ProxyLog

func ProxyLog(logLevel LogLevel, messageData *byte, messageSize int) Status

func ProxyRecordMetric

func ProxyRecordMetric(metricID uint32, value uint64) Status

func ProxyRedisCall

func ProxyRedisCall(upstreamData *byte, upstreamSize int, queryData *byte, querySize int, calloutIDPtr *uint32) Status

func ProxyRedisInit

func ProxyRedisInit(upstreamData *byte, upstreamSize int, usernameData *byte, usernameSize int,
	passwordData *byte, passwordSize int, timeout uint32) Status

func ProxyRegisterSharedQueue

func ProxyRegisterSharedQueue(nameData *byte, nameSize int, returnID *uint32) Status

func ProxyRemoveHeaderMapValue

func ProxyRemoveHeaderMapValue(mapType MapType, keyData *byte, keySize int) Status

func ProxyReplaceHeaderMapValue

func ProxyReplaceHeaderMapValue(mapType MapType, keyData *byte, keySize int, valueData *byte, valueSize int) Status

func ProxyResolveSharedQueue

func ProxyResolveSharedQueue(vmIDData *byte, vmIDSize int, nameData *byte, nameSize int, returnID *uint32) Status

func ProxySendLocalResponse

func ProxySendLocalResponse(statusCode uint32, statusCodeDetailData *byte,
	statusCodeDetailsSize int, bodyData *byte, bodySize int, headersData *byte, headersSize int, grpcStatus int32) Status

func ProxySetBufferBytes

func ProxySetBufferBytes(bufferType BufferType, start int, maxSize int, bufferData *byte, bufferSize int) Status

func ProxySetEffectiveContext

func ProxySetEffectiveContext(contextID uint32) Status

func ProxySetHeaderMapPairs

func ProxySetHeaderMapPairs(mapType MapType, mapData *byte, mapSize int) Status

func ProxySetProperty

func ProxySetProperty(pathData *byte, pathSize int, valueData *byte, valueSize int) Status

func ProxySetSharedData

func ProxySetSharedData(keyData *byte, keySize int, valueData *byte, valueSize int, cas uint32) Status

func ProxySetTickPeriodMilliseconds

func ProxySetTickPeriodMilliseconds(period uint32) Status

type StreamType

type StreamType uint32
const (
	StreamTypeRequest    StreamType = 0
	StreamTypeResponse   StreamType = 1
	StreamTypeDownstream StreamType = 2
	StreamTypeUpstream   StreamType = 3
)

Directories

Path Synopsis
proxy_wasm_version

Jump to

Keyboard shortcuts

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