Documentation ¶
Index ¶
- Constants
- Variables
- func LogCritical(message string)
- func LogCriticalf(format string, v ...any)
- func LogDebug(message string)
- func LogDebugf(format string, v ...any)
- func LogError(message string)
- func LogErrorf(format string, v ...any)
- func LogInfo(message string)
- func LogInfof(format string, v ...any)
- func LogTrace(message string)
- func LogTracef(format string, v ...any)
- func LogWarn(message string)
- func LogWarnf(format string, v ...any)
- func SetCommonCAPI(api CommonCAPI)
- type AccessLogType
- type BufferAction
- type BufferInstance
- type CommonCAPI
- type ConfigCallbackHandler
- type ConfigCallbacks
- type ConnectionCallback
- type ConnectionCloseType
- type ConnectionEvent
- type ConnectionInfoType
- type CounterMetric
- type DataBufferBase
- type DestroyReason
- type DownstreamFilter
- type DynamicMetadata
- type EmptyDownstreamFilter
- type EmptyUpstreamFilter
- func (*EmptyUpstreamFilter) OnData(buffer []byte, endOfStream bool) FilterStatus
- func (*EmptyUpstreamFilter) OnEvent(event ConnectionEvent)
- func (*EmptyUpstreamFilter) OnPoolFailure(poolFailureReason PoolFailureReason, transportFailureReason string)
- func (*EmptyUpstreamFilter) OnPoolReady(cb ConnectionCallback)
- type EnvoyRequestPhase
- type FilterCallbackHandler
- type FilterCallbacks
- type FilterState
- type FilterStatus
- type GaugeMetric
- type HeaderMap
- type HistogramMetric
- type HttpCAPI
- type LifeSpan
- type LogType
- type MetadataMap
- type MetricType
- type NetworkCAPI
- type PassThroughStreamDecoderFilter
- type PassThroughStreamEncoderFilter
- type PassThroughStreamFilter
- type PoolFailureReason
- type RequestHeaderMap
- type RequestTrailerMap
- type ResponseHeaderMap
- type ResponseTrailerMap
- type StateType
- type StatusType
- type StreamDecoderFilter
- type StreamEncoderFilter
- type StreamFilter
- type StreamFilterCallbacks
- type StreamFilterConfigFactory
- type StreamFilterConfigParser
- type StreamFilterFactory
- type StreamInfo
- type StreamSharing
- type UpstreamFilter
Constants ¶
const ( NormalFinalize int = 0 // normal, finalize on destroy GCFinalize int = 1 // finalize in GC sweep )
Variables ¶
var ( ErrInternalFailure = errors.New("internal failure") ErrValueNotFound = errors.New("value not found") // Failed to serialize the value when we fetch the value as string ErrSerializationFailure = errors.New("serialization failure") )
*************** errors start **************//
Functions ¶
func LogCritical ¶ added in v1.28.0
func LogCritical(message string)
func LogCriticalf ¶ added in v1.28.0
func SetCommonCAPI ¶ added in v1.28.0
func SetCommonCAPI(api CommonCAPI)
SetCommonCAPI for mock cAPI
Types ¶
type AccessLogType ¶ added in v1.28.0
type AccessLogType int
For each AccessLogType's meaning, see https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage Currently, only some downstream access log types are supported
const ( AccessLogNotSet AccessLogType = 0 AccessLogTcpUpstreamConnected AccessLogType = 1 AccessLogTcpPeriodic AccessLogType = 2 AccessLogTcpConnectionEnd AccessLogType = 3 AccessLogDownstreamStart AccessLogType = 4 AccessLogDownstreamPeriodic AccessLogType = 5 AccessLogDownstreamEnd AccessLogType = 6 AccessLogUpstreamPoolReady AccessLogType = 7 AccessLogUpstreamPeriodic AccessLogType = 8 AccessLogUpstreamEnd AccessLogType = 9 AccessLogDownstreamTunnelSuccessfullyEstablished AccessLogType = 10 )
type BufferAction ¶
type BufferAction int
*************** BufferInstance start **************//
const ( SetBuffer BufferAction = 0 AppendBuffer BufferAction = 1 PrependBuffer BufferAction = 2 )
type BufferInstance ¶
type BufferInstance interface { DataBufferBase // Set overwrite the whole buffer content with byte slice. Set([]byte) error // SetString overwrite the whole buffer content with string. SetString(string) error // Prepend prepend the contents of the slice data to the buffer. Prepend(data []byte) error // Prepend prepend the contents of the string data to the buffer. PrependString(s string) error // Append append the contents of the string data to the buffer. AppendString(s string) error }
type CommonCAPI ¶ added in v1.28.0
type ConfigCallbackHandler ¶ added in v1.28.0
type ConfigCallbackHandler interface { ConfigCallbacks }
type ConfigCallbacks ¶ added in v1.28.0
type ConfigCallbacks interface { // Define a metric, for different MetricType, name must be different, // for same MetricType, the same name will share a metric. DefineCounterMetric(name string) CounterMetric DefineGaugeMetric(name string) GaugeMetric }
type ConnectionCallback ¶
type ConnectionCallback interface { // StreamInfo returns the stream info of the connection StreamInfo() StreamInfo // Write data to the connection. Write(buffer []byte, endStream bool) // Close the connection. Close(closeType ConnectionCloseType) }
type ConnectionCloseType ¶
type ConnectionCloseType int
Type of connection close to perform.
const ( // Flush pending write data before raising ConnectionEvent::LocalClose FlushWrite ConnectionCloseType = 0 // Do not flush any pending data. Write the pending data to buffer and then immediately // raise ConnectionEvent::LocalClose NoFlush ConnectionCloseType = 1 // Flush pending write data and delay raising a ConnectionEvent::LocalClose // until the delayed_close_timeout expires FlushWriteAndDelay ConnectionCloseType = 2 // Do not write/flush any pending data and immediately raise ConnectionEvent::LocalClose Abort ConnectionCloseType = 3 // Do not write/flush any pending data and immediately raise // ConnectionEvent::LocalClose. Envoy will try to close the connection with RST flag. AbortReset ConnectionCloseType = 4 )
func (ConnectionCloseType) String ¶
func (t ConnectionCloseType) String() string
type ConnectionEvent ¶
type ConnectionEvent int
Events that occur on a connection.
const ( RemoteClose ConnectionEvent = 0 LocalClose ConnectionEvent = 1 Connected ConnectionEvent = 2 ConnectedZeroRtt ConnectionEvent = 3 )
func (ConnectionEvent) String ¶
func (e ConnectionEvent) String() string
type ConnectionInfoType ¶
type ConnectionInfoType int
const ( ConnectionInfoLocalAddr ConnectionInfoType = 0 ConnectionInfoRemoteAddr ConnectionInfoType = 1 )
func (ConnectionInfoType) String ¶
func (t ConnectionInfoType) String() string
type CounterMetric ¶ added in v1.28.0
type DataBufferBase ¶
type DataBufferBase interface { // Write appends the contents of p to the buffer, growing the buffer as // needed. The return value n is the length of p; err is always nil. If the // buffer becomes too large, Write will panic with ErrTooLarge. Write(p []byte) (n int, err error) // WriteString appends the string to the buffer, growing the buffer as // needed. The return value n is the length of s; err is always nil. If the // buffer becomes too large, Write will panic with ErrTooLarge. WriteString(s string) (n int, err error) // WriteByte appends the byte to the buffer, growing the buffer as // needed. The return value n is the length of s; err is always nil. If the // buffer becomes too large, Write will panic with ErrTooLarge. WriteByte(p byte) error // WriteUint16 appends the uint16 to the buffer, growing the buffer as // needed. The return value n is the length of s; err is always nil. If the // buffer becomes too large, Write will panic with ErrTooLarge. WriteUint16(p uint16) error // WriteUint32 appends the uint32 to the buffer, growing the buffer as // needed. The return value n is the length of s; err is always nil. If the // buffer becomes too large, Write will panic with ErrTooLarge. WriteUint32(p uint32) error // WriteUint64 appends the uint64 to the buffer, growing the buffer as // needed. The return value n is the length of s; err is always nil. If the // buffer becomes too large, Write will panic with ErrTooLarge. WriteUint64(p uint64) error // Bytes returns all bytes from buffer, without draining any buffered data. // It can be used to get fixed-length content, such as headers, body. // Note: do not change content in return bytes, use write instead Bytes() []byte // Drain drains a offset length of bytes in buffer. // It can be used with Bytes(), after consuming a fixed-length of data Drain(offset int) // Len returns the number of bytes of the unread portion of the buffer; // b.Len() == len(b.Bytes()). Len() int // Reset resets the buffer to be empty. Reset() // String returns the contents of the buffer as a string. String() string // Append append the contents of the slice data to the buffer. Append(data []byte) error }
type DestroyReason ¶
type DestroyReason int
const ( Normal DestroyReason = 0 Terminate DestroyReason = 1 )
type DownstreamFilter ¶
type DownstreamFilter interface { // Called when a connection is first established. OnNewConnection() FilterStatus // Called when data is read on the connection. OnData(buffer []byte, endOfStream bool) FilterStatus // Callback for connection events. OnEvent(event ConnectionEvent) // Called when data is to be written on the connection. OnWrite(buffer []byte, endOfStream bool) FilterStatus }
type DynamicMetadata ¶
type EmptyDownstreamFilter ¶ added in v1.28.0
type EmptyDownstreamFilter struct{}
EmptyDownstreamFilter provides the no-op implementation of the DownstreamFilter interface
func (*EmptyDownstreamFilter) OnData ¶ added in v1.28.0
func (*EmptyDownstreamFilter) OnData(buffer []byte, endOfStream bool) FilterStatus
func (*EmptyDownstreamFilter) OnEvent ¶ added in v1.28.0
func (*EmptyDownstreamFilter) OnEvent(event ConnectionEvent)
func (*EmptyDownstreamFilter) OnNewConnection ¶ added in v1.28.0
func (*EmptyDownstreamFilter) OnNewConnection() FilterStatus
func (*EmptyDownstreamFilter) OnWrite ¶ added in v1.28.0
func (*EmptyDownstreamFilter) OnWrite(buffer []byte, endOfStream bool) FilterStatus
type EmptyUpstreamFilter ¶ added in v1.28.0
type EmptyUpstreamFilter struct{}
EmptyUpstreamFilter provides the no-op implementation of the UpstreamFilter interface
func (*EmptyUpstreamFilter) OnData ¶ added in v1.28.0
func (*EmptyUpstreamFilter) OnData(buffer []byte, endOfStream bool) FilterStatus
func (*EmptyUpstreamFilter) OnEvent ¶ added in v1.28.0
func (*EmptyUpstreamFilter) OnEvent(event ConnectionEvent)
func (*EmptyUpstreamFilter) OnPoolFailure ¶ added in v1.28.0
func (*EmptyUpstreamFilter) OnPoolFailure(poolFailureReason PoolFailureReason, transportFailureReason string)
func (*EmptyUpstreamFilter) OnPoolReady ¶ added in v1.28.0
func (*EmptyUpstreamFilter) OnPoolReady(cb ConnectionCallback)
type EnvoyRequestPhase ¶
type EnvoyRequestPhase int
const ( DecodeHeaderPhase EnvoyRequestPhase = iota + 1 DecodeDataPhase DecodeTrailerPhase EncodeHeaderPhase EncodeDataPhase EncodeTrailerPhase )
func (EnvoyRequestPhase) String ¶
func (e EnvoyRequestPhase) String() string
type FilterCallbackHandler ¶
type FilterCallbackHandler interface { FilterCallbacks }
type FilterCallbacks ¶
type FilterCallbacks interface { StreamFilterCallbacks // Continue or SendLocalReply should be last API invoked, no more code after them. Continue(StatusType) SendLocalReply(responseCode int, bodyText string, headers map[string][]string, grpcStatus int64, details string) // RecoverPanic recover panic in defer and terminate the request by SendLocalReply with 500 status code. RecoverPanic() Log(level LogType, msg string) LogLevel() LogType // GetProperty fetch Envoy attribute and return the value as a string. // The list of attributes can be found in https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/advanced/attributes. // If the fetch succeeded, a string will be returned. // If the value is a timestamp, it is returned as a timestamp string like "2023-07-31T07:21:40.695646+00:00". // If the fetch failed (including the value is not found), an error will be returned. // // The error can be one of: // * ErrInternalFailure // * ErrSerializationFailure (Currently, fetching attributes in List/Map type are unsupported) // * ErrValueNotFound GetProperty(key string) (string, error) }
type FilterState ¶
type FilterStatus ¶
type FilterStatus int
Status codes returned by filters that can cause future filters to not get iterated to.
const ( // Continue to further filters. NetworkFilterContinue FilterStatus = 0 // Stop executing further filters. NetworkFilterStopIteration FilterStatus = 1 )
func (FilterStatus) String ¶
func (s FilterStatus) String() string
type GaugeMetric ¶ added in v1.28.0
type HeaderMap ¶
type HeaderMap interface { // GetRaw is unsafe, reuse the memory from Envoy GetRaw(name string) string // Get value of key // If multiple values associated with this key, first one will be returned. Get(key string) (string, bool) // Values returns all values associated with the given key. // The returned slice is not a copy. Values(key string) []string // Set key-value pair in header map, the previous pair will be replaced if exists. // It may not take affects immediately in the Envoy thread side when it's invoked in a Go thread. Set(key, value string) // Add value for given key. // Multiple headers with the same key may be added with this function. // Use Set for setting a single header for the given key. // It may not take affects immediately in the Envoy thread side when it's invoked in a Go thread. Add(key, value string) // Del delete pair of specified key // It may not take affects immediately in the Envoy thread side when it's invoked in a Go thread. Del(key string) // Range calls f sequentially for each key and value present in the map. // If f returns false, range stops the iteration. // When there are multiple values of a key, f will be invoked multiple times with the same key and each value. Range(f func(key, value string) bool) // RangeWithCopy calls f sequentially for each key and value copied from the map. RangeWithCopy(f func(key, value string) bool) }
refer https://github.com/envoyproxy/envoy/blob/main/envoy/http/header_map.h
type HttpCAPI ¶
type HttpCAPI interface { HttpContinue(r unsafe.Pointer, status uint64) HttpSendLocalReply(r unsafe.Pointer, responseCode int, bodyText string, headers map[string][]string, grpcStatus int64, details string) // Send a specialized reply that indicates that the filter has failed on the go side. Internally this is used for // when unhandled panics are detected. HttpSendPanicReply(r unsafe.Pointer, details string) // experience api, memory unsafe HttpGetHeader(r unsafe.Pointer, key string) string HttpCopyHeaders(r unsafe.Pointer, num uint64, bytes uint64) map[string][]string HttpSetHeader(r unsafe.Pointer, key string, value string, add bool) HttpRemoveHeader(r unsafe.Pointer, key string) HttpGetBuffer(r unsafe.Pointer, bufferPtr uint64, length uint64) []byte HttpDrainBuffer(r unsafe.Pointer, bufferPtr uint64, length uint64) HttpSetBufferHelper(r unsafe.Pointer, bufferPtr uint64, value string, action BufferAction) HttpSetBytesBufferHelper(r unsafe.Pointer, bufferPtr uint64, value []byte, action BufferAction) HttpCopyTrailers(r unsafe.Pointer, num uint64, bytes uint64) map[string][]string HttpSetTrailer(r unsafe.Pointer, key string, value string, add bool) HttpRemoveTrailer(r unsafe.Pointer, key string) HttpGetStringValue(r unsafe.Pointer, id int) (string, bool) HttpGetIntegerValue(r unsafe.Pointer, id int) (uint64, bool) HttpGetDynamicMetadata(r unsafe.Pointer, filterName string) map[string]interface{} HttpSetDynamicMetadata(r unsafe.Pointer, filterName string, key string, value interface{}) HttpLog(level LogType, message string) HttpLogLevel() LogType HttpFinalize(r unsafe.Pointer, reason int) HttpConfigFinalize(c unsafe.Pointer) HttpSetStringFilterState(r unsafe.Pointer, key string, value string, stateType StateType, lifeSpan LifeSpan, streamSharing StreamSharing) HttpGetStringFilterState(r unsafe.Pointer, key string) string HttpGetStringProperty(r unsafe.Pointer, key string) (string, error) HttpDefineMetric(c unsafe.Pointer, metricType MetricType, name string) uint32 HttpIncrementMetric(c unsafe.Pointer, metricId uint32, offset int64) HttpGetMetric(c unsafe.Pointer, metricId uint32) uint64 HttpRecordMetric(c unsafe.Pointer, metricId uint32, value uint64) }
type LogType ¶
type LogType int
****************** log level start ******************//
const ( Trace LogType = 0 Debug LogType = 1 Info LogType = 2 Warn LogType = 3 Error LogType = 4 Critical LogType = 5 )
refer https://github.com/envoyproxy/envoy/blob/main/source/common/common/base_logger.h
func GetLogLevel ¶ added in v1.28.0
func GetLogLevel() LogType
type MetadataMap ¶
type MetadataMap interface { }
type MetricType ¶ added in v1.28.0
type MetricType uint32
const ( Counter MetricType = 0 Gauge MetricType = 1 Histogram MetricType = 2 )
type NetworkCAPI ¶
type NetworkCAPI interface { // DownstreamWrite writes buffer data into downstream connection. DownstreamWrite(f unsafe.Pointer, bufferPtr unsafe.Pointer, bufferLen int, endStream int) // DownstreamClose closes the downstream connection DownstreamClose(f unsafe.Pointer, closeType int) // DownstreamFinalize cleans up the resource of downstream connection, should be called only by runtime.SetFinalizer DownstreamFinalize(f unsafe.Pointer, reason int) // DownstreamInfo gets the downstream connection info of infoType DownstreamInfo(f unsafe.Pointer, infoType int) string // GetFilterState gets the filter state of key GetFilterState(f unsafe.Pointer, key string) string // SetFilterState sets the filter state of key to value SetFilterState(f unsafe.Pointer, key string, value string, stateType StateType, lifeSpan LifeSpan, streamSharing StreamSharing) // UpstreamConnect creates an envoy upstream connection to address UpstreamConnect(libraryID string, addr string, connID uint64) unsafe.Pointer // UpstreamWrite writes buffer data into upstream connection. UpstreamWrite(f unsafe.Pointer, bufferPtr unsafe.Pointer, bufferLen int, endStream int) // UpstreamClose closes the upstream connection UpstreamClose(f unsafe.Pointer, closeType int) // UpstreamFinalize cleans up the resource of upstream connection, should be called only by runtime.SetFinalizer UpstreamFinalize(f unsafe.Pointer, reason int) // UpstreamInfo gets the upstream connection info of infoType UpstreamInfo(f unsafe.Pointer, infoType int) string }
type PassThroughStreamDecoderFilter ¶
type PassThroughStreamDecoderFilter struct{}
PassThroughStreamDecoderFilter provides the no-op implementation of the StreamDecoderFilter interface.
func (*PassThroughStreamDecoderFilter) DecodeData ¶
func (*PassThroughStreamDecoderFilter) DecodeData(BufferInstance, bool) StatusType
func (*PassThroughStreamDecoderFilter) DecodeHeaders ¶
func (*PassThroughStreamDecoderFilter) DecodeHeaders(RequestHeaderMap, bool) StatusType
func (*PassThroughStreamDecoderFilter) DecodeTrailers ¶
func (*PassThroughStreamDecoderFilter) DecodeTrailers(RequestTrailerMap) StatusType
type PassThroughStreamEncoderFilter ¶
type PassThroughStreamEncoderFilter struct{}
PassThroughStreamEncoderFilter provides the no-op implementation of the StreamEncoderFilter interface.
func (*PassThroughStreamEncoderFilter) EncodeData ¶
func (*PassThroughStreamEncoderFilter) EncodeData(BufferInstance, bool) StatusType
func (*PassThroughStreamEncoderFilter) EncodeHeaders ¶
func (*PassThroughStreamEncoderFilter) EncodeHeaders(ResponseHeaderMap, bool) StatusType
func (*PassThroughStreamEncoderFilter) EncodeTrailers ¶
func (*PassThroughStreamEncoderFilter) EncodeTrailers(ResponseTrailerMap) StatusType
type PassThroughStreamFilter ¶
type PassThroughStreamFilter struct { PassThroughStreamDecoderFilter PassThroughStreamEncoderFilter }
PassThroughStreamFilter provides the no-op implementation of the StreamFilter interface.
func (*PassThroughStreamFilter) OnDestroy ¶
func (*PassThroughStreamFilter) OnDestroy(DestroyReason)
func (*PassThroughStreamFilter) OnLog ¶ added in v1.28.0
func (*PassThroughStreamFilter) OnLog()
func (*PassThroughStreamFilter) OnLogDownstreamPeriodic ¶ added in v1.28.0
func (*PassThroughStreamFilter) OnLogDownstreamPeriodic()
func (*PassThroughStreamFilter) OnLogDownstreamStart ¶ added in v1.28.0
func (*PassThroughStreamFilter) OnLogDownstreamStart()
type PoolFailureReason ¶
type PoolFailureReason int
const ( // A resource overflowed and policy prevented a new connection from being created. Overflow PoolFailureReason = 0 // A local connection failure took place while creating a new connection. LocalConnectionFailure PoolFailureReason = 1 // A remote connection failure took place while creating a new connection. RemoteConnectionFailure PoolFailureReason = 2 // A timeout occurred while creating a new connection. Timeout PoolFailureReason = 3 )
func (PoolFailureReason) String ¶
func (r PoolFailureReason) String() string
type RequestHeaderMap ¶
type RequestTrailerMap ¶
type RequestTrailerMap interface { HeaderMap }
type ResponseHeaderMap ¶
type ResponseTrailerMap ¶
type ResponseTrailerMap interface { HeaderMap }
type StatusType ¶
type StatusType int
****************** filter status start ******************//
const ( Running StatusType = 0 LocalReply StatusType = 1 Continue StatusType = 2 StopAndBuffer StatusType = 3 StopAndBufferWatermark StatusType = 4 StopNoBuffer StatusType = 5 )
const ( HeaderContinue StatusType = 100 HeaderStopIteration StatusType = 101 HeaderContinueAndDontEndStream StatusType = 102 HeaderStopAllIterationAndBuffer StatusType = 103 HeaderStopAllIterationAndWatermark StatusType = 104 )
header status refer https://github.com/envoyproxy/envoy/blob/main/envoy/http/filter.h
const ( DataContinue StatusType = 200 DataStopIterationAndBuffer StatusType = 201 DataStopIterationAndWatermark StatusType = 202 DataStopIterationNoBuffer StatusType = 203 )
data status refer https://github.com/envoyproxy/envoy/blob/main/envoy/http/filter.h
const ( TrailerContinue StatusType = 300 TrailerStopIteration StatusType = 301 )
Trailer status refer https://github.com/envoyproxy/envoy/blob/main/envoy/http/filter.h
type StreamDecoderFilter ¶
type StreamDecoderFilter interface { DecodeHeaders(RequestHeaderMap, bool) StatusType DecodeData(BufferInstance, bool) StatusType DecodeTrailers(RequestTrailerMap) StatusType }
request
type StreamEncoderFilter ¶
type StreamEncoderFilter interface { EncodeHeaders(ResponseHeaderMap, bool) StatusType EncodeData(BufferInstance, bool) StatusType EncodeTrailers(ResponseTrailerMap) StatusType }
response
type StreamFilter ¶
type StreamFilter interface { // http request StreamDecoderFilter // response stream StreamEncoderFilter // log OnLog() OnLogDownstreamStart() OnLogDownstreamPeriodic() // destroy filter OnDestroy(DestroyReason) }
type StreamFilterCallbacks ¶
type StreamFilterCallbacks interface {
StreamInfo() StreamInfo
}
type StreamFilterConfigFactory ¶
type StreamFilterConfigFactory func(config interface{}) StreamFilterFactory
type StreamFilterConfigParser ¶
type StreamFilterConfigParser interface { Parse(any *anypb.Any, callbacks ConfigCallbackHandler) (interface{}, error) Merge(parentConfig interface{}, childConfig interface{}) interface{} }
type StreamFilterFactory ¶
type StreamFilterFactory func(callbacks FilterCallbackHandler) StreamFilter
type StreamInfo ¶
type StreamInfo interface { GetRouteName() string FilterChainName() string // Protocol return the request's protocol. Protocol() (string, bool) // ResponseCode return the response code. ResponseCode() (uint32, bool) // ResponseCodeDetails return the response code details. ResponseCodeDetails() (string, bool) // AttemptCount return the number of times the request was attempted upstream. AttemptCount() uint32 // Get the dynamic metadata of the request DynamicMetadata() DynamicMetadata // DownstreamLocalAddress return the downstream local address. DownstreamLocalAddress() string // DownstreamRemoteAddress return the downstream remote address. DownstreamRemoteAddress() string // UpstreamLocalAddress return the upstream local address. UpstreamLocalAddress() (string, bool) // UpstreamRemoteAddress return the upstream remote address. UpstreamRemoteAddress() (string, bool) // UpstreamClusterName return the upstream host cluster. UpstreamClusterName() (string, bool) // FilterState return the filter state interface. FilterState() FilterState // VirtualClusterName returns the name of the virtual cluster which got matched VirtualClusterName() (string, bool) }
stream info refer https://github.com/envoyproxy/envoy/blob/main/envoy/stream_info/stream_info.h
type UpstreamFilter ¶
type UpstreamFilter interface { // Called when a connection is available to process a request/response. OnPoolReady(cb ConnectionCallback) // Called when a pool error occurred and no connection could be acquired for making the request. OnPoolFailure(poolFailureReason PoolFailureReason, transportFailureReason string) // Invoked when data is delivered from the upstream connection. OnData(buffer []byte, endOfStream bool) // Callback for connection events. OnEvent(event ConnectionEvent) }