lbhash

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cookie struct {
	// required, the name of the cookie to be used to obtain the hash key
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// If specified, a cookie with the TTL will be generated if the cookie is not present. If the TTL is present and zero, the generated cookie will be a session cookie.
	Ttl *time.Duration `protobuf:"bytes,2,opt,name=ttl,proto3,stdduration" json:"ttl,omitempty"`
	// The name of the path for the cookie. If no path is specified here, no path will be set for the cookie.
	Path                 string   `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Envoy supports two types of cookie affinity: - Passive: Envoy reads the cookie from the headers - Generated: Envoy uses the cookie spec to generate a cookie In either case, the cookie is incorporated in the hash key. additional notes https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/route/route.proto#envoy-api-msg-route-routeaction-hashpolicy-cookie

func (*Cookie) Descriptor

func (*Cookie) Descriptor() ([]byte, []int)

func (*Cookie) Equal

func (this *Cookie) Equal(that interface{}) bool

func (*Cookie) GetName

func (m *Cookie) GetName() string

func (*Cookie) GetPath

func (m *Cookie) GetPath() string

func (*Cookie) GetTtl

func (m *Cookie) GetTtl() *time.Duration

func (*Cookie) Hash added in v1.2.13

func (m *Cookie) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*Cookie) ProtoMessage

func (*Cookie) ProtoMessage()

func (*Cookie) Reset

func (m *Cookie) Reset()

func (*Cookie) String

func (m *Cookie) String() string

func (*Cookie) XXX_DiscardUnknown

func (m *Cookie) XXX_DiscardUnknown()

func (*Cookie) XXX_Marshal

func (m *Cookie) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Cookie) XXX_Merge

func (m *Cookie) XXX_Merge(src proto.Message)

func (*Cookie) XXX_Size

func (m *Cookie) XXX_Size() int

func (*Cookie) XXX_Unmarshal

func (m *Cookie) XXX_Unmarshal(b []byte) error

type HashPolicy

type HashPolicy struct {
	// Types that are valid to be assigned to KeyType:
	//	*HashPolicy_Header
	//	*HashPolicy_Cookie
	//	*HashPolicy_SourceIp
	KeyType isHashPolicy_KeyType `protobuf_oneof:"KeyType"`
	// If set, and a hash key is available after evaluating this policy, Envoy will skip the subsequent policies and
	// use the key as it is.
	// This is useful for defining "fallback" policies and limiting the time Envoy spends generating hash keys.
	Terminal             bool     `protobuf:"varint,4,opt,name=terminal,proto3" json:"terminal,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Specifies an element of Envoy's hashing policy for hashing load balancers

func (*HashPolicy) Descriptor

func (*HashPolicy) Descriptor() ([]byte, []int)

func (*HashPolicy) Equal

func (this *HashPolicy) Equal(that interface{}) bool

func (*HashPolicy) GetCookie

func (m *HashPolicy) GetCookie() *Cookie

func (*HashPolicy) GetHeader

func (m *HashPolicy) GetHeader() string

func (*HashPolicy) GetKeyType

func (m *HashPolicy) GetKeyType() isHashPolicy_KeyType

func (*HashPolicy) GetSourceIp

func (m *HashPolicy) GetSourceIp() bool

func (*HashPolicy) GetTerminal

func (m *HashPolicy) GetTerminal() bool

func (*HashPolicy) Hash added in v1.2.13

func (m *HashPolicy) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*HashPolicy) ProtoMessage

func (*HashPolicy) ProtoMessage()

func (*HashPolicy) Reset

func (m *HashPolicy) Reset()

func (*HashPolicy) String

func (m *HashPolicy) String() string

func (*HashPolicy) XXX_DiscardUnknown

func (m *HashPolicy) XXX_DiscardUnknown()

func (*HashPolicy) XXX_Marshal

func (m *HashPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HashPolicy) XXX_Merge

func (m *HashPolicy) XXX_Merge(src proto.Message)

func (*HashPolicy) XXX_OneofWrappers

func (*HashPolicy) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*HashPolicy) XXX_Size

func (m *HashPolicy) XXX_Size() int

func (*HashPolicy) XXX_Unmarshal

func (m *HashPolicy) XXX_Unmarshal(b []byte) error
type HashPolicy_Cookie struct {
	Cookie *Cookie `protobuf:"bytes,2,opt,name=cookie,proto3,oneof" json:"cookie,omitempty"`
}

func (*HashPolicy_Cookie) Equal

func (this *HashPolicy_Cookie) Equal(that interface{}) bool

type HashPolicy_Header

type HashPolicy_Header struct {
	Header string `protobuf:"bytes,1,opt,name=header,proto3,oneof" json:"header,omitempty"`
}

func (*HashPolicy_Header) Equal

func (this *HashPolicy_Header) Equal(that interface{}) bool

type HashPolicy_SourceIp

type HashPolicy_SourceIp struct {
	SourceIp bool `protobuf:"varint,3,opt,name=source_ip,json=sourceIp,proto3,oneof" json:"source_ip,omitempty"`
}

func (*HashPolicy_SourceIp) Equal

func (this *HashPolicy_SourceIp) Equal(that interface{}) bool

type RouteActionHashConfig

type RouteActionHashConfig struct {
	// The list of policies Envoy will use when generating a hash key for a hashing load balancer
	HashPolicies         []*HashPolicy `protobuf:"bytes,1,rep,name=hash_policies,json=hashPolicies,proto3" json:"hash_policies,omitempty"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

Specifies the route’s hashing policy if the upstream cluster uses a hashing load balancer. https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/route/route.proto#envoy-api-msg-route-routeaction-hashpolicy

func (*RouteActionHashConfig) Descriptor

func (*RouteActionHashConfig) Descriptor() ([]byte, []int)

func (*RouteActionHashConfig) Equal

func (this *RouteActionHashConfig) Equal(that interface{}) bool

func (*RouteActionHashConfig) GetHashPolicies

func (m *RouteActionHashConfig) GetHashPolicies() []*HashPolicy

func (*RouteActionHashConfig) Hash added in v1.2.13

func (m *RouteActionHashConfig) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*RouteActionHashConfig) ProtoMessage

func (*RouteActionHashConfig) ProtoMessage()

func (*RouteActionHashConfig) Reset

func (m *RouteActionHashConfig) Reset()

func (*RouteActionHashConfig) String

func (m *RouteActionHashConfig) String() string

func (*RouteActionHashConfig) XXX_DiscardUnknown

func (m *RouteActionHashConfig) XXX_DiscardUnknown()

func (*RouteActionHashConfig) XXX_Marshal

func (m *RouteActionHashConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RouteActionHashConfig) XXX_Merge

func (m *RouteActionHashConfig) XXX_Merge(src proto.Message)

func (*RouteActionHashConfig) XXX_Size

func (m *RouteActionHashConfig) XXX_Size() int

func (*RouteActionHashConfig) XXX_Unmarshal

func (m *RouteActionHashConfig) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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