baggage

package
v2.11.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2018 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultRestrictionManager

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

DefaultRestrictionManager allows any baggage key.

func NewDefaultRestrictionManager

func NewDefaultRestrictionManager(maxValueLength int) *DefaultRestrictionManager

NewDefaultRestrictionManager returns a DefaultRestrictionManager.

func (*DefaultRestrictionManager) GetRestriction

func (m *DefaultRestrictionManager) GetRestriction(service, key string) *Restriction

GetRestriction implements RestrictionManager#GetRestriction.

type Restriction

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

Restriction determines whether a baggage key is allowed and contains any restrictions on the baggage value.

func NewRestriction

func NewRestriction(keyAllowed bool, maxValueLength int) *Restriction

NewRestriction returns a new Restriction.

func (*Restriction) KeyAllowed

func (r *Restriction) KeyAllowed() bool

KeyAllowed returns whether the baggage key for this restriction is allowed.

func (*Restriction) MaxValueLength

func (r *Restriction) MaxValueLength() int

MaxValueLength returns the max length for the baggage value.

type RestrictionManager

type RestrictionManager interface {
	GetRestriction(service, key string) *Restriction
}

RestrictionManager keeps track of valid baggage keys and their restrictions. The manager will return a Restriction for a specific baggage key which will determine whether the baggage key is allowed for the current service and any other applicable restrictions on the baggage value.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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