affinity

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package affinity Session affinity store and missing-identity policy.

Index

Constants

This section is empty.

Variables

View Source
var ErrIdentityRequired = errors.New("affinity: identity required")

Functions

This section is empty.

Types

type Binding

type Binding struct {
	Key          Key
	BackendID    string
	CandidateKey string
	Model        string
	UpdatedAt    time.Time
	Reason       string
}

func BindingFromCandidate

func BindingFromCandidate(key Key, cand routing.AttemptCandidate, now time.Time, reason string) Binding

type IdentityInput

type IdentityInput struct {
	Mode                  routing.AffinityMode
	Session               session.SessionView
	Principal             execview.PrincipalView
	MissingIdentityPolicy MissingIdentityPolicy
}

type Key

type Key struct {
	Scope Scope
	ID    string
}

func ResolveKey

func ResolveKey(in IdentityInput) (Key, bool, error)

func (Key) Valid

func (k Key) Valid() bool

type MissingIdentityPolicy

type MissingIdentityPolicy string
const (
	MissingIdentityIgnore     MissingIdentityPolicy = "ignore"
	MissingIdentityFailClosed MissingIdentityPolicy = "fail_closed"
)

type Scope

type Scope string
const (
	ScopeSession Scope = "session"
	ScopeClient  Scope = "client"
)

type Store

type Store interface {
	Get(ctx context.Context, key Key) (Binding, bool, error)
	Set(ctx context.Context, binding Binding) error
	Delete(ctx context.Context, key Key) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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