app

package
v0.0.0-...-f890aeb Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeSessions

func ComputeSessions(ctx context.Context, stats []domain.PlayerPIT, start, end time.Time) []domain.Session

NOTE: All domain.PlayerPIT entries must be for the same player

Types

type FindMilestoneAchievements

type FindMilestoneAchievements func(ctx context.Context, playerUUID string, gamemode domain.Gamemode, stat domain.Stat, milestones []int64) ([]domain.MilestoneAchievement, error)

func BuildFindMilestoneAchievements

func BuildFindMilestoneAchievements(
	repo milestonePlayerRepository,
	getAndPersistPlayerWithCache GetAndPersistPlayerWithCache,
) FindMilestoneAchievements

type GetAccountByUUID

type GetAccountByUUID func(ctx context.Context, uuid string) (domain.Account, error)

func BuildGetAccountByUUIDWithCache

func BuildGetAccountByUUIDWithCache(
	accountByUUIDCache cache.Cache[domain.Account],
	provider accountProviderByUUID,
	repo accountRepositoryByUUID,
	nowFunc func() time.Time,
) (GetAccountByUUID, error)

type GetAccountByUsername

type GetAccountByUsername func(ctx context.Context, username string) (domain.Account, error)

func BuildGetAccountByUsernameWithCache

func BuildGetAccountByUsernameWithCache(
	accountByUsernameCache cache.Cache[domain.Account],
	provider accountProviderByUsername,
	repo accountRepositoryByUsername,
	nowFunc func() time.Time,
) (GetAccountByUsername, error)

type GetAndPersistPlayerWithCache

type GetAndPersistPlayerWithCache func(ctx context.Context, uuid string) (*domain.PlayerPIT, error)

type GetHistory

type GetHistory = func(
	ctx context.Context,
	uuid string,
	start, end time.Time,
	limit int,
) ([]domain.PlayerPIT, error)

func BuildGetHistory

func BuildGetHistory(
	repo playerrepository.PlayerRepository,
	updatePlayerInInterval UpdatePlayerInInterval,
) GetHistory

type GetPlayerPITs

type GetPlayerPITs = func(
	ctx context.Context,
	uuid string,
	start, end time.Time,
) ([]domain.PlayerPIT, error)

func BuildGetPlayerPITs

func BuildGetPlayerPITs(
	repo playerPITsPlayerRepository,
	updatePlayerInInterval UpdatePlayerInInterval,
) GetPlayerPITs

type GetPrismNotices

type GetPrismNotices = func(
	ctx context.Context,
	userID string,
	prismVersion string,
	updateSelection UpdateSelection,
) []PrismNotice

func BuildGetPrismNotices

func BuildGetPrismNotices(nowFunc func() time.Time) GetPrismNotices

type GetTags

type GetTags func(ctx context.Context, uuid string, apiKey *string) (domain.Tags, error)

func BuildGetTagsWithCache

func BuildGetTagsWithCache(
	tagsByUUIDCache cache.Cache[domain.Tags],
	provider tagProvider,
) (GetTags, error)

type PrismNotice

type PrismNotice struct {
	Message         string
	URL             string
	Severity        Severity
	DurationSeconds *float64
}

type RegisterUserVisit

type RegisterUserVisit func(ctx context.Context, userID string, ipHash string, userAgent string) (domain.User, error)

func BuildRegisterUserVisit

func BuildRegisterUserVisit(repo userRepository) RegisterUserVisit

type Severity

type Severity string
const (
	SeverityInfo     Severity = "info"
	SeverityUpdate   Severity = "update"
	SeverityWarning  Severity = "warning"
	SeverityCritical Severity = "critical"
)

type UpdatePlayerInInterval

type UpdatePlayerInInterval func(ctx context.Context, uuid string, start, end time.Time) error

Ensure that the player data is up to date in the repository in the given interval.

func BuildUpdatePlayerInInterval

func BuildUpdatePlayerInInterval(
	getAndPersistPlayerWithCache GetAndPersistPlayerWithCache,
	nowFunc func() time.Time,
) UpdatePlayerInInterval

type UpdateSelection

type UpdateSelection int
const (
	UpdateSelectionNone UpdateSelection = iota
	UpdateSelectionMinor
	UpdateSelectionAll
)

Jump to

Keyboard shortcuts

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