http

package
v0.0.0-...-e3e1183 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAttributesByPlugins

func AddAttributesByPlugins(builder *utils.AttributesBuilder)

func RegisterAttributesBuilderPlugin

func RegisterAttributesBuilderPlugin(plugin AttributesBuilderPlugin)

Types

type AttributesBuilderPlugin

type AttributesBuilderPlugin interface {
	AddAttributes(builder *utils.AttributesBuilder)
}

type CheckData

type CheckData interface {
	// Find "x-istio-attributes" HTTP header.
	// If found, base64 decode its value,  pass it out
	ExtractIstioAttributes() (data string, ret bool)

	// Get downstream tcp connection ip and port.
	GetSourceIPPort() (ip string, port int32, ret bool)
}

CheckData extract HTTP data for Mixer check

func NewCheckData

func NewCheckData(reqHeaders types.HeaderMap, requestInfo types.RequestInfo) CheckData

NewCheckData return checkData

type ClientContext

type ClientContext struct {
	*control.ClientContextBase
}

ClientContext is the global context object to hold: * the mixer client config * the mixer client object to call Check/Report with cache.

func NewClientContext

func NewClientContext(config *v2.Mixer) *ClientContext

NewClientContext return ClientContext

type ReportData

type ReportData interface {
	// GetReportInfo return ReportInfo
	GetReportInfo() (data ReportInfo)

	// GetDestinationIPPort return destination ip and port
	GetDestinationIPPort() (ip string, port int, err error)

	// GetResponseHeaders return response HTTP headers
	GetResponseHeaders() (headers types.HeaderMap)
}

ReportData extract HTTP data for Mixer report. Implemented by the environment (Envoy) and used by the library.

func NewReportData

func NewReportData(respHeaders types.HeaderMap, requestInfo types.RequestInfo, requestTotalSize uint64) ReportData

NewReportData return ReportData

type ReportInfo

type ReportInfo struct {
	// contains filtered or unexported fields
}

ReportInfo get additional report info.

type RequestHandler

type RequestHandler interface {
	Report(checkData CheckData, reportData ReportData)
}

RequestHandler handle a HTTP request

func NewRequestHandler

func NewRequestHandler(serviceContext *ServiceContext) RequestHandler

NewRequestHandler return RequestHandler

type ServiceContext

type ServiceContext struct {
	// contains filtered or unexported fields
}

ServiceContext hold service config for HTTP

func NewServiceContext

func NewServiceContext(clientContext *ClientContext) *ServiceContext

NewServiceContext return ServiceContext

func (*ServiceContext) AddStaticAttributes

func (s *ServiceContext) AddStaticAttributes(requestContext *control.RequestContext)

AddStaticAttributes add static mixer attributes.

func (*ServiceContext) GetClientContext

func (s *ServiceContext) GetClientContext() *ClientContext

GetClientContext return ClientContext

func (*ServiceContext) HasMixerConfig

func (s *ServiceContext) HasMixerConfig() bool

HasMixerConfig return if or not has mixer config

func (*ServiceContext) SetServiceConfig

func (s *ServiceContext) SetServiceConfig(config *client.ServiceConfig)

SetServiceConfig set ServiceConfig

Jump to

Keyboard shortcuts

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