proxywasm

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorRootContextNotFound = errors.New("root context not found")

Functions

func AddHttpRequestHeader

func AddHttpRequestHeader(key, value string) error

func AddHttpRequestTrailer

func AddHttpRequestTrailer(key, value string) error

func AddHttpResponseHeader

func AddHttpResponseHeader(key, value string) error

func AddHttpResponseTrailer

func AddHttpResponseTrailer(key, value string) error

func DequeueSharedQueue

func DequeueSharedQueue(queueID uint32) ([]byte, error)

func DeserializeMap

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

func DispatchHttpCall

func DispatchHttpCall(upstream string,
	headers [][2]string, body string, trailers [][2]string,
	timeoutMillisecond uint32, callBack HttpCalloutCallBack) (calloutID uint32, err error)

func EnqueueSharedQueue

func EnqueueSharedQueue(queueID uint32, data []byte) error

func FinishVMContext

func FinishVMContext()

func GetDownStreamData

func GetDownStreamData(start, maxSize int) ([]byte, error)

func GetHttpCallResponseBody

func GetHttpCallResponseBody(start, maxSize int) ([]byte, error)

func GetHttpCallResponseHeaders

func GetHttpCallResponseHeaders() ([][2]string, error)

func GetHttpCallResponseTrailers

func GetHttpCallResponseTrailers() ([][2]string, error)

func GetHttpRequestBody

func GetHttpRequestBody(start, maxSize int) ([]byte, error)

func GetHttpRequestHeader

func GetHttpRequestHeader(key string) (string, error)

func GetHttpRequestHeaders

func GetHttpRequestHeaders() ([][2]string, error)

func GetHttpRequestTrailer

func GetHttpRequestTrailer(key string) (string, error)

func GetHttpRequestTrailers

func GetHttpRequestTrailers() ([][2]string, error)

func GetHttpResponseBody

func GetHttpResponseBody(start, maxSize int) ([]byte, error)

func GetHttpResponseHeader

func GetHttpResponseHeader(key string) (string, error)

func GetHttpResponseHeaders

func GetHttpResponseHeaders() ([][2]string, error)

func GetHttpResponseTrailer

func GetHttpResponseTrailer(key string) (string, error)

func GetHttpResponseTrailers

func GetHttpResponseTrailers() ([][2]string, error)

func GetPluginConfiguration

func GetPluginConfiguration(size int) ([]byte, error)

func GetProperty

func GetProperty(path []string) ([]byte, error)

func GetSharedData

func GetSharedData(key string) (value []byte, cas uint32, err error)

func GetUpstreamData

func GetUpstreamData(start, maxSize int) ([]byte, error)

func GetVMConfiguration

func GetVMConfiguration(size int) ([]byte, error)

func LogCritical

func LogCritical(msg string)

func LogCriticalf

func LogCriticalf(format string, args ...interface{})

func LogDebug

func LogDebug(msg string)

func LogDebugf

func LogDebugf(format string, args ...interface{})

func LogError

func LogError(msg string)

func LogErrorf

func LogErrorf(format string, args ...interface{})

func LogInfo

func LogInfo(msg string)

func LogInfof

func LogInfof(format string, args ...interface{})

func LogTrace

func LogTrace(msg string)

func LogTracef

func LogTracef(format string, args ...interface{})

func LogWarn

func LogWarn(msg string)

func LogWarnf

func LogWarnf(format string, args ...interface{})

func RawBytePtrToByteSlice

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

func RawBytePtrToString

func RawBytePtrToString(raw *byte, size int) string

func RegisterSharedQueue

func RegisterSharedQueue(name string) (uint32, error)

func RemoveHttpRequestHeader

func RemoveHttpRequestHeader(key string) error

func RemoveHttpRequestTrailer

func RemoveHttpRequestTrailer(key string) error

func RemoveHttpResponseHeader

func RemoveHttpResponseHeader(key string) error

func RemoveHttpResponseTrailer

func RemoveHttpResponseTrailer(key string) error

func ResolveSharedQueue

func ResolveSharedQueue(vmID, queueName string) (uint32, error)

TODO: not sure if the ABI is correct

func ResumeHttpRequest

func ResumeHttpRequest() error

func ResumeHttpResponse

func ResumeHttpResponse() error

func SendHttpResponse

func SendHttpResponse(statusCode uint32, headers [][2]string, body string) types.Status

func SerializeMap

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

func SerializePropertyPath

func SerializePropertyPath(path []string) []byte

func SetEffectiveContext

func SetEffectiveContext(contextID uint32)

func SetHttpRequestBody

func SetHttpRequestBody(body []byte) error

func SetHttpRequestHeader

func SetHttpRequestHeader(key, value string) error

func SetHttpRequestHeaders

func SetHttpRequestHeaders(headers [][2]string) error

func SetHttpRequestTrailer

func SetHttpRequestTrailer(key, value string) error

func SetHttpRequestTrailers

func SetHttpRequestTrailers(headers [][2]string) error

func SetHttpResponseBody

func SetHttpResponseBody(body []byte) error

func SetHttpResponseHeader

func SetHttpResponseHeader(key, value string) error

func SetHttpResponseHeaders

func SetHttpResponseHeaders(headers [][2]string) error

func SetHttpResponseTrailer

func SetHttpResponseTrailer(key, value string) error

func SetHttpResponseTrailers

func SetHttpResponseTrailers(headers [][2]string) error

func SetNewHttpContext

func SetNewHttpContext(f func(rootContextID, contextID uint32) HttpContext)

func SetNewRootContext

func SetNewRootContext(f func(contextID uint32) RootContext)

func SetNewStreamContext

func SetNewStreamContext(f func(rootContextID, contextID uint32) StreamContext)

func SetProperty

func SetProperty(path string, data []byte) error

func SetSharedData

func SetSharedData(key string, data []byte, cas uint32) error

func SetTickPeriodMilliSeconds

func SetTickPeriodMilliSeconds(millSec uint32) error

Types

type DefaultHttpContext

type DefaultHttpContext struct{}

func (*DefaultHttpContext) OnHttpRequestBody

func (*DefaultHttpContext) OnHttpRequestBody(int, bool) types.Action

func (*DefaultHttpContext) OnHttpRequestHeaders

func (*DefaultHttpContext) OnHttpRequestHeaders(int, bool) types.Action

impl HttpContext

func (*DefaultHttpContext) OnHttpRequestTrailers

func (*DefaultHttpContext) OnHttpRequestTrailers(int) types.Action

func (*DefaultHttpContext) OnHttpResponseBody

func (*DefaultHttpContext) OnHttpResponseBody(int, bool) types.Action

func (*DefaultHttpContext) OnHttpResponseHeaders

func (*DefaultHttpContext) OnHttpResponseHeaders(int, bool) types.Action

func (*DefaultHttpContext) OnHttpResponseTrailers

func (*DefaultHttpContext) OnHttpResponseTrailers(int) types.Action

func (*DefaultHttpContext) OnHttpStreamDone

func (*DefaultHttpContext) OnHttpStreamDone()

func (*DefaultHttpContext) OnLog

func (*DefaultHttpContext) OnLog()

type DefaultRootContext

type DefaultRootContext struct{}

func (*DefaultRootContext) OnLog

func (*DefaultRootContext) OnLog()

func (*DefaultRootContext) OnPluginStart

func (*DefaultRootContext) OnPluginStart(int) bool

func (*DefaultRootContext) OnQueueReady

func (*DefaultRootContext) OnQueueReady(uint32)

impl RootContext

func (*DefaultRootContext) OnTick

func (*DefaultRootContext) OnTick()

func (*DefaultRootContext) OnVMDone

func (*DefaultRootContext) OnVMDone() bool

func (*DefaultRootContext) OnVMStart

func (*DefaultRootContext) OnVMStart(int) bool

type DefaultStreamContext

type DefaultStreamContext struct{}

func (*DefaultStreamContext) OnDownstreamClose

func (*DefaultStreamContext) OnDownstreamClose(types.PeerType)

func (*DefaultStreamContext) OnDownstreamData

func (*DefaultStreamContext) OnDownstreamData(int, bool) types.Action

impl StreamContext

func (*DefaultStreamContext) OnLog

func (*DefaultStreamContext) OnLog()

func (*DefaultStreamContext) OnNewConnection

func (*DefaultStreamContext) OnNewConnection() types.Action

func (*DefaultStreamContext) OnStreamDone

func (*DefaultStreamContext) OnStreamDone()

func (*DefaultStreamContext) OnUpstreamClose

func (*DefaultStreamContext) OnUpstreamClose(types.PeerType)

func (*DefaultStreamContext) OnUpstreamData

func (*DefaultStreamContext) OnUpstreamData(int, bool) types.Action

type HttpCalloutCallBack

type HttpCalloutCallBack = func(numHeaders, bodySize, numTrailers int)

type HttpContext

type HttpContext interface {
	OnHttpRequestHeaders(numHeaders int, endOfStream bool) types.Action
	OnHttpRequestBody(bodySize int, endOfStream bool) types.Action
	OnHttpRequestTrailers(numTrailers int) types.Action
	OnHttpResponseHeaders(numHeaders int, endOfStream bool) types.Action
	OnHttpResponseBody(bodySize int, endOfStream bool) types.Action
	OnHttpResponseTrailers(numTrailers int) types.Action
	OnHttpStreamDone()
	OnLog()
}

type MetricCounter

type MetricCounter uint32

func DefineCounterMetric

func DefineCounterMetric(name string) MetricCounter

func (MetricCounter) Get

func (m MetricCounter) Get() uint64

func (MetricCounter) ID

func (m MetricCounter) ID() uint32

func (MetricCounter) Increment

func (m MetricCounter) Increment(offset uint64)

type MetricGauge

type MetricGauge uint32

func DefineGaugeMetric

func DefineGaugeMetric(name string) MetricGauge

func (MetricGauge) Add

func (m MetricGauge) Add(offset int64)

func (MetricGauge) Get

func (m MetricGauge) Get() int64

func (MetricGauge) ID

func (m MetricGauge) ID() uint32

type MetricHistogram

type MetricHistogram uint32

func DefineHistogramMetric

func DefineHistogramMetric(name string) MetricHistogram

func (MetricHistogram) Get

func (m MetricHistogram) Get() uint64

func (MetricHistogram) ID

func (m MetricHistogram) ID() uint32

func (MetricHistogram) Record

func (m MetricHistogram) Record(value uint64)

type RootContext

type RootContext interface {
	OnQueueReady(queueID uint32)
	OnTick()
	OnVMStart(vmConfigurationSize int) bool
	OnPluginStart(pluginConfigurationSize int) bool
	OnVMDone() bool
	OnLog()
}

func GetRootContextByID

func GetRootContextByID(rootContextID uint32) (RootContext, error)

type StreamContext

type StreamContext interface {
	OnDownstreamData(dataSize int, endOfStream bool) types.Action
	OnDownstreamClose(peerType types.PeerType)
	OnNewConnection() types.Action
	OnUpstreamData(dataSize int, endOfStream bool) types.Action
	OnUpstreamClose(peerType types.PeerType)
	OnStreamDone()
	OnLog()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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