aiseats

package
v2.33.3 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SeatTracker

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

SeatTracker records current AI seat state for users.

func New

func New(db store, logger slog.Logger, clock quartz.Clock, auditor *atomic.Pointer[audit.Auditor]) *SeatTracker

func (*SeatTracker) RecordUsage

func (t *SeatTracker) RecordUsage(ctx context.Context, userID uuid.UUID, reason agplaiseats.Reason)

RecordUsage will record the AI seat usage for the user. There is a race condition between checking if the user should be recorded or throttled and actually recording. This is fine, as it just means we record the usage twice. The throttle just exists to prevent excessive database queries.

Jump to

Keyboard shortcuts

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