internal

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 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 added in v0.20.0

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

func ProxyOnContextCreate added in v0.20.0

func ProxyOnContextCreate(contextID uint32, pluginContextID uint32)

func ProxyOnDelete added in v0.20.0

func ProxyOnDelete(contextID uint32)

func ProxyOnDone added in v0.20.0

func ProxyOnDone(contextID uint32) bool

func ProxyOnDownstreamConnectionClose added in v0.20.0

func ProxyOnDownstreamConnectionClose(contextID uint32, pType types.PeerType)

func ProxyOnDownstreamData added in v0.20.0

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

func ProxyOnHttpCallResponse added in v0.20.0

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

func ProxyOnLog added in v0.20.0

func ProxyOnLog(pluginContextID uint32)

func ProxyOnNewConnection added in v0.20.0

func ProxyOnNewConnection(contextID uint32) types.Action

func ProxyOnQueueReady added in v0.20.0

func ProxyOnQueueReady(contextID, queueID uint32)

func ProxyOnRequestBody added in v0.20.0

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

func ProxyOnRequestHeaders added in v0.20.0

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

func ProxyOnRequestTrailers added in v0.20.0

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

func ProxyOnResponseBody added in v0.20.0

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

func ProxyOnResponseHeaders added in v0.20.0

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

func ProxyOnResponseTrailers added in v0.20.0

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

func ProxyOnTick added in v0.20.0

func ProxyOnTick(pluginContextID uint32)

func ProxyOnUpstreamConnectionClose added in v0.20.0

func ProxyOnUpstreamConnectionClose(contextID uint32, pType types.PeerType)

func ProxyOnUpstreamData added in v0.20.0

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

func ProxyOnVMStart added in v0.20.0

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 added in v0.20.0

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

func SerializeMap

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

func SerializePropertyPath

func SerializePropertyPath(path []string) []byte

func SetVMContext added in v0.13.0

func SetVMContext(vmContext types.VMContext)

func StatusToError

func StatusToError(status Status) error

func StringBytePtr

func StringBytePtr(msg string) *byte

func VMStateGetActiveContextID added in v0.20.0

func VMStateGetActiveContextID() uint32

func VMStateReset added in v0.20.0

func VMStateReset()

func VMStateSetActiveContextID added in v0.20.0

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
)

type DefaultProxyWAMSHost added in v0.20.0

type DefaultProxyWAMSHost struct{}

func (DefaultProxyWAMSHost) ProxyAddHeaderMapValue added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxyCallForeignFunction added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxyCloseStream added in v0.20.0

func (d DefaultProxyWAMSHost) ProxyCloseStream(streamType StreamType) Status

func (DefaultProxyWAMSHost) ProxyContinueStream added in v0.20.0

func (d DefaultProxyWAMSHost) ProxyContinueStream(streamType StreamType) Status

func (DefaultProxyWAMSHost) ProxyDefineMetric added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxyDequeueSharedQueue added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxyDone added in v0.20.0

func (d DefaultProxyWAMSHost) ProxyDone() Status

func (DefaultProxyWAMSHost) ProxyEnqueueSharedQueue added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxyGetBufferBytes added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxyGetHeaderMapPairs added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxyGetHeaderMapValue added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxyGetMetric added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxyGetProperty added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxyGetSharedData added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxyHttpCall added in v0.20.0

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 added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxyLog added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxyRecordMetric added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxyRegisterSharedQueue added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxyRemoveHeaderMapValue added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxyReplaceHeaderMapValue added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxyResolveSharedQueue added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxySendLocalResponse added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxySetBufferBytes added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxySetEffectiveContext added in v0.20.0

func (d DefaultProxyWAMSHost) ProxySetEffectiveContext(contextID uint32) Status

func (DefaultProxyWAMSHost) ProxySetHeaderMapPairs added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxySetProperty added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxySetSharedData added in v0.20.0

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

func (DefaultProxyWAMSHost) ProxySetTickPeriodMilliseconds added in v0.20.0

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 added in v0.20.0

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
	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 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
)

Jump to

Keyboard shortcuts

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