Documentation
¶
Index ¶
- type AffinityStore
- func (s *AffinityStore) CountByService(serviceID string) int
- func (s *AffinityStore) Delete(ruleUUID, sessionID string)
- func (s *AffinityStore) DeleteByRule(ruleUUID string)
- func (s *AffinityStore) GC()
- func (s *AffinityStore) Get(ruleUUID, sessionID string) (*routing.AffinityEntry, bool)
- func (s *AffinityStore) Set(ruleUUID, sessionID string, entry *routing.AffinityEntry)
- func (s *AffinityStore) StartGC()
- func (s *AffinityStore) UpdateMessageID(ruleUUID, sessionID, messageID string)
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) 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