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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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