utils

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KContextProtocol const string
	KContextProtocol = "context.protocol"

	// KDestinationIP const string
	KDestinationIP = "destination.ip"

	// KDestinationPort const string
	KDestinationPort = "destination.port"

	// KOriginIP const string
	KOriginIP = "origin.ip"

	// KRequestTime const string
	KRequestTime = "request.time"
	// KRequestBodySize const string
	KRequestBodySize = "request.size"

	// const string
	KRequestTotalSize = "request.total_size"

	// KResponseCode const string
	KResponseCode = "response.code"
	// KResponseDuration const string
	KResponseDuration = "response.duration"
	// KResponseHeaders const string
	KResponseHeaders = "response.headers"
	// KResponseBodySize const string
	KResponseBodySize = "response.size"
	// KResponseTotalSize const string
	KResponseTotalSize = "response.total_size"
	// KResponseTime const string
	KResponseTime = "response.time"

	// KRequestHeaders const string
	KRequestHeaders = "request.headers"
	// KRequestPath const string
	KRequestPath = "request.path"
	// KRequestUrlPath const string
	KRequestUrlPath = "request.url_path"
	// KRequestQueryParms const string
	KRequestQueryParms = "request.query_params"
	// KRequestMethod const string
	KRequestMethod = "request.method"
	// KRequestHost const string
	KRequestHost = "request.host"

	// KDestinationServiceHost const string
	KDestinationServiceHost = "destination.service.host"
	// KDestinationServiceName const string
	KDestinationServiceName = "destination.service.name"
	// KDestinationServiceNamespace const string
	KDestinationServiceNamespace = "destination.service.namespace"
	// KContextReporterKind const string
	KContextReporterKind = "context.reporter.kind"
)

Define attribute names

View Source
const (
	// KIstioAttributeHeader is the istio attribute name
	KIstioAttributeHeader = "x-istio-attributes"
)

Variables

This section is empty.

Functions

func FormatAttributesString

func FormatAttributesString(attributes *v1.Attributes) (str string, err error)

FormatAttributesString return attributes json string

func GetDestinationUID

func GetDestinationUID(metadata api.Metadata) (uid string, err error)

GetDestinationUID function

func GetIPPort

func GetIPPort(address net.Addr) (ip string, port int32, ret bool)

GetIPPort return ip and port of address

Types

type AttributesBuilder

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

AttributesBuilder to add attribute to protobuf Attributes.

func NewAttributesBuilder

func NewAttributesBuilder(attributes *v1.Attributes) *AttributesBuilder

NewAttributesBuilder return AttributesBuilder

func (*AttributesBuilder) AddBool

func (a *AttributesBuilder) AddBool(key string, value bool)

AddBool function

func (*AttributesBuilder) AddBytes

func (a *AttributesBuilder) AddBytes(key string, data []byte)

AddBytes function

func (*AttributesBuilder) AddDouble

func (a *AttributesBuilder) AddDouble(key string, value float64)

AddDouble function

func (*AttributesBuilder) AddDuration

func (a *AttributesBuilder) AddDuration(key string, value time.Duration)

AddDuration function

func (*AttributesBuilder) AddInt64

func (a *AttributesBuilder) AddInt64(key string, data int64)

AddInt64 function

func (*AttributesBuilder) AddString

func (a *AttributesBuilder) AddString(key string, value string)

AddString function

func (*AttributesBuilder) AddStringMap

func (a *AttributesBuilder) AddStringMap(key string, stringMap types.HeaderMap)

AddStringMap function

func (*AttributesBuilder) AddTimestamp

func (a *AttributesBuilder) AddTimestamp(key string, t time.Time)

AddTimestamp function

func (*AttributesBuilder) HasAttribute

func (a *AttributesBuilder) HasAttribute(key string) bool

HasAttribute function

Jump to

Keyboard shortcuts

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