affinity

package
v0.260716.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AffinityStore

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

AffinityStore maps (ruleUUID, sessionID) -> locked Service. It directly implements routing.AffinityStore interface.

func NewAffinityStore

func NewAffinityStore(ttl time.Duration) *AffinityStore

NewAffinityStore creates a new affinity store with the given TTL

func (*AffinityStore) CountByService

func (s *AffinityStore) CountByService(serviceID string) int

CountByService returns the number of sessions locked to the given serviceID that were created within the capacity active window (last 30 minutes). This provides a "recently active users" count for seat utilization calculation.

func (*AffinityStore) Delete

func (s *AffinityStore) Delete(ruleUUID, sessionID string)

Delete removes an affinity entry for the given rule and session

func (*AffinityStore) DeleteByRule

func (s *AffinityStore) DeleteByRule(ruleUUID string)

DeleteByRule removes all affinity entries for a given rule UUID

func (*AffinityStore) GC

func (s *AffinityStore) GC()

GC removes expired entries from the store

func (*AffinityStore) Get

func (s *AffinityStore) Get(ruleUUID, sessionID string) (*routing.AffinityEntry, bool)

Get retrieves an affinity entry for the given rule and session

func (*AffinityStore) Set

func (s *AffinityStore) Set(ruleUUID, sessionID string, entry *routing.AffinityEntry)

Set stores an affinity entry for the given rule and session

func (*AffinityStore) StartGC

func (s *AffinityStore) StartGC()

StartGC starts a background goroutine that periodically cleans up expired entries

func (*AffinityStore) UpdateMessageID

func (s *AffinityStore) UpdateMessageID(ruleUUID, sessionID, messageID string)

UpdateMessageID updates the message ID for an existing affinity entry

Jump to

Keyboard shortcuts

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