proxywasm

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2020 License: Apache-2.0 Imports: 6 Imported by: 91

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHttpRequestHeader added in v0.0.5

func AddHttpRequestHeader(key, value string) error

func AddHttpRequestTrailer added in v0.0.5

func AddHttpRequestTrailer(key, value string) error

func AddHttpResponseHeader added in v0.0.5

func AddHttpResponseHeader(key, value string) error

func AddHttpResponseTrailer added in v0.0.5

func AddHttpResponseTrailer(key, value string) error

func DequeueSharedQueue added in v0.0.5

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

func DeserializeMap

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

func DispatchHttpCall added in v0.0.5

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

func EnqueueSharedQueue added in v0.0.5

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

func FinishContext added in v0.0.5

func FinishContext()

func GetCurrentTime added in v0.0.5

func GetCurrentTime() int64

func GetDownStreamData added in v0.0.5

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

func GetHttpCallResponseBody added in v0.0.5

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

func GetHttpCallResponseHeaders added in v0.0.5

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

func GetHttpCallResponseTrailers added in v0.0.5

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

func GetHttpRequestBody added in v0.0.5

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

func GetHttpRequestHeader added in v0.0.5

func GetHttpRequestHeader(key string) (string, error)

func GetHttpRequestHeaders added in v0.0.5

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

func GetHttpRequestTrailer added in v0.0.5

func GetHttpRequestTrailer(key string) (string, error)

func GetHttpRequestTrailers added in v0.0.5

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

func GetHttpResponseBody added in v0.0.5

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

func GetHttpResponseHeader added in v0.0.5

func GetHttpResponseHeader(key string) (string, error)

func GetHttpResponseHeaders added in v0.0.5

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

func GetHttpResponseTrailer added in v0.0.5

func GetHttpResponseTrailer(key string) (string, error)

func GetHttpResponseTrailers added in v0.0.5

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

func GetPluginConfiguration added in v0.0.5

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

func GetProperty added in v0.0.5

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

func GetSharedData added in v0.0.5

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

func GetUpstreamData added in v0.0.5

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

func GetVMConfiguration added in v0.0.5

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

func LogCritical

func LogCritical(msg string)

func LogCriticalf added in v0.0.4

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

func LogDebug

func LogDebug(msg string)

func LogDebugf added in v0.0.4

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

func LogError

func LogError(msg string)

func LogErrorf added in v0.0.4

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

func LogInfo

func LogInfo(msg string)

func LogInfof added in v0.0.4

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

func LogTrace

func LogTrace(msg string)

func LogTracef added in v0.0.4

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

func LogWarn

func LogWarn(msg string)

func LogWarnf added in v0.0.4

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

func RegisterSharedQueue(name string) (uint32, error)

func RemoveHttpRequestHeader added in v0.0.5

func RemoveHttpRequestHeader(key string) error

func RemoveHttpRequestTrailer added in v0.0.5

func RemoveHttpRequestTrailer(key string) error

func RemoveHttpResponseHeader added in v0.0.5

func RemoveHttpResponseHeader(key string) error

func RemoveHttpResponseTrailer added in v0.0.5

func RemoveHttpResponseTrailer(key string) error

func ResolveSharedQueue added in v0.0.5

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

TODO: not sure if the ABI is correct

func ResumeHttpRequest added in v0.0.5

func ResumeHttpRequest() error

func ResumeHttpResponse added in v0.0.5

func ResumeHttpResponse() error

func SendHttpResponse added in v0.0.5

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

func SerializeMap

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

func SerializePropertyPath added in v0.0.3

func SerializePropertyPath(path []string) []byte

func SetEffectiveContext added in v0.0.5

func SetEffectiveContext(contextID uint32)

func SetHttpRequestHeader added in v0.0.5

func SetHttpRequestHeader(key, value string) error

func SetHttpRequestHeaders added in v0.0.5

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

func SetHttpRequestTrailer added in v0.0.5

func SetHttpRequestTrailer(key, value string) error

func SetHttpRequestTrailers added in v0.0.5

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

func SetHttpResponseHeader added in v0.0.5

func SetHttpResponseHeader(key, value string) error

func SetHttpResponseHeaders added in v0.0.5

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

func SetHttpResponseTrailer added in v0.0.5

func SetHttpResponseTrailer(key, value string) error

func SetHttpResponseTrailers added in v0.0.5

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

func SetNewHttpContext

func SetNewHttpContext(f func(contextID uint32) HttpContext)

func SetNewRootContext

func SetNewRootContext(f func(contextID uint32) RootContext)

func SetNewStreamContext

func SetNewStreamContext(f func(contextID uint32) StreamContext)

func SetProperty added in v0.0.5

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

func SetSharedData added in v0.0.5

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

func SetTickPeriodMilliSeconds added in v0.0.5

func SetTickPeriodMilliSeconds(millSec uint32) error

Types

type DefaultHttpContext added in v0.0.5

type DefaultHttpContext struct{}

func (*DefaultHttpContext) OnHttpRequestBody added in v0.0.5

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

func (*DefaultHttpContext) OnHttpRequestHeaders added in v0.0.5

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

impl HttpContext

func (*DefaultHttpContext) OnHttpRequestTrailers added in v0.0.5

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

func (*DefaultHttpContext) OnHttpResponseBody added in v0.0.5

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

func (*DefaultHttpContext) OnHttpResponseHeaders added in v0.0.5

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

func (*DefaultHttpContext) OnHttpResponseTrailers added in v0.0.5

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

func (*DefaultHttpContext) OnHttpStreamDone added in v0.0.5

func (*DefaultHttpContext) OnHttpStreamDone()

type DefaultRootContext added in v0.0.5

type DefaultRootContext struct{}

func (*DefaultRootContext) OnPluginStart added in v0.0.5

func (*DefaultRootContext) OnPluginStart(int) bool

func (*DefaultRootContext) OnQueueReady added in v0.0.5

func (*DefaultRootContext) OnQueueReady(uint32)

impl RootContext

func (*DefaultRootContext) OnTick added in v0.0.5

func (*DefaultRootContext) OnTick()

func (*DefaultRootContext) OnVMDone added in v0.0.5

func (*DefaultRootContext) OnVMDone() bool

func (*DefaultRootContext) OnVMStart added in v0.0.5

func (*DefaultRootContext) OnVMStart(int) bool

type DefaultStreamContext added in v0.0.5

type DefaultStreamContext struct{}

func (*DefaultStreamContext) OnDownstreamClose added in v0.0.5

func (*DefaultStreamContext) OnDownstreamClose(types.PeerType)

func (*DefaultStreamContext) OnDownstreamData added in v0.0.5

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

impl StreamContext

func (*DefaultStreamContext) OnNewConnection added in v0.0.5

func (*DefaultStreamContext) OnNewConnection() types.Action

func (*DefaultStreamContext) OnStreamDone added in v0.0.5

func (*DefaultStreamContext) OnStreamDone()

func (*DefaultStreamContext) OnUpstreamClose added in v0.0.5

func (*DefaultStreamContext) OnUpstreamClose(types.PeerType)

func (*DefaultStreamContext) OnUpstreamData added in v0.0.5

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

type HttpCalloutCallBack added in v0.0.5

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

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
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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