Documentation ¶
Index ¶
- Variables
- type CookieBasedSessionState
- func (*CookieBasedSessionState) Descriptor() ([]byte, []int)deprecated
- func (x *CookieBasedSessionState) GetCookie() *v3.Cookie
- func (*CookieBasedSessionState) ProtoMessage()
- func (x *CookieBasedSessionState) ProtoReflect() protoreflect.Message
- func (x *CookieBasedSessionState) Reset()
- func (x *CookieBasedSessionState) String() string
- func (m *CookieBasedSessionState) Validate() error
- func (m *CookieBasedSessionState) ValidateAll() error
- type CookieBasedSessionStateMultiError
- type CookieBasedSessionStateValidationError
- func (e CookieBasedSessionStateValidationError) Cause() error
- func (e CookieBasedSessionStateValidationError) Error() string
- func (e CookieBasedSessionStateValidationError) ErrorName() string
- func (e CookieBasedSessionStateValidationError) Field() string
- func (e CookieBasedSessionStateValidationError) Key() bool
- func (e CookieBasedSessionStateValidationError) Reason() string
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type CookieBasedSessionState ¶
type CookieBasedSessionState struct { // The cookie configuration used to track session state. Cookie *v3.Cookie `protobuf:"bytes,1,opt,name=cookie,proto3" json:"cookie,omitempty"` // contains filtered or unexported fields }
This extension allows the session state to be tracked via cookies.
This extension first encodes the address of the upstream host selected by the load balancer into a “set-cookie“ response header with the :ref:`cookie configuration <envoy_v3_api_field_extensions.http.stateful_session.cookie.v3.CookieBasedSessionState.cookie>`. when new requests are incoming, this extension will try to parse the specific upstream host address by the cookie name. If the address parsed from the cookie corresponds to a valid upstream host, this upstream host will be selected first. See :ref:`stateful session filter <envoy_v3_api_msg_extensions.filters.http.stateful_session.v3.StatefulSession>`.
For example, if the cookie name is set to “sticky-host“, envoy will prefer “1.2.3.4:80“ as the upstream host when the request contains the following header:
.. code-block:: none
cookie: sticky-host="MS4yLjMuNDo4MA=="
When processing the upstream response, if “1.2.3.4:80“ is indeed the final choice the extension does nothing. If “1.2.3.4:80“ is not the final choice, the new selected host will be used to update the cookie (via the “set-cookie“ response header).
[#extension: envoy.http.stateful_session.cookie]
func (*CookieBasedSessionState) Descriptor
deprecated
func (*CookieBasedSessionState) Descriptor() ([]byte, []int)
Deprecated: Use CookieBasedSessionState.ProtoReflect.Descriptor instead.
func (*CookieBasedSessionState) GetCookie ¶
func (x *CookieBasedSessionState) GetCookie() *v3.Cookie
func (*CookieBasedSessionState) ProtoMessage ¶
func (*CookieBasedSessionState) ProtoMessage()
func (*CookieBasedSessionState) ProtoReflect ¶
func (x *CookieBasedSessionState) ProtoReflect() protoreflect.Message
func (*CookieBasedSessionState) Reset ¶
func (x *CookieBasedSessionState) Reset()
func (*CookieBasedSessionState) String ¶
func (x *CookieBasedSessionState) String() string
func (*CookieBasedSessionState) Validate ¶
func (m *CookieBasedSessionState) Validate() error
Validate checks the field values on CookieBasedSessionState with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*CookieBasedSessionState) ValidateAll ¶
func (m *CookieBasedSessionState) ValidateAll() error
ValidateAll checks the field values on CookieBasedSessionState with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CookieBasedSessionStateMultiError, or nil if none found.
type CookieBasedSessionStateMultiError ¶
type CookieBasedSessionStateMultiError []error
CookieBasedSessionStateMultiError is an error wrapping multiple validation errors returned by CookieBasedSessionState.ValidateAll() if the designated constraints aren't met.
func (CookieBasedSessionStateMultiError) AllErrors ¶
func (m CookieBasedSessionStateMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CookieBasedSessionStateMultiError) Error ¶
func (m CookieBasedSessionStateMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CookieBasedSessionStateValidationError ¶
type CookieBasedSessionStateValidationError struct {
// contains filtered or unexported fields
}
CookieBasedSessionStateValidationError is the validation error returned by CookieBasedSessionState.Validate if the designated constraints aren't met.
func (CookieBasedSessionStateValidationError) Cause ¶
func (e CookieBasedSessionStateValidationError) Cause() error
Cause function returns cause value.
func (CookieBasedSessionStateValidationError) Error ¶
func (e CookieBasedSessionStateValidationError) Error() string
Error satisfies the builtin error interface
func (CookieBasedSessionStateValidationError) ErrorName ¶
func (e CookieBasedSessionStateValidationError) ErrorName() string
ErrorName returns error name.
func (CookieBasedSessionStateValidationError) Field ¶
func (e CookieBasedSessionStateValidationError) Field() string
Field function returns field value.
func (CookieBasedSessionStateValidationError) Key ¶
func (e CookieBasedSessionStateValidationError) Key() bool
Key function returns key value.
func (CookieBasedSessionStateValidationError) Reason ¶
func (e CookieBasedSessionStateValidationError) Reason() string
Reason function returns reason value.