util

package
v9.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2019 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExpireAt

func GetExpireAt(leaderboardPublicID string) (int64, error)

GetExpireAt returns a timestamp when the key should expire or -1 if the key doesn't match any valid auto expire regexes

func MonthlyExpiration

func MonthlyExpiration(startTime time.Time) time.Time

MonthlyExpiration calculates the expireAt date for leaderboards with quarterly format

func QuarterlyExpiration

func QuarterlyExpiration(year, quarter int64) time.Time

QuarterlyExpiration calculates the expireAt date for leaderboards with quarterly format

func WeeklyExpiration

func WeeklyExpiration(year, week int64) time.Time

WeeklyExpiration calculates the expireAt date for leaderboards with weekly format

Types

type InvalidDurationError

type InvalidDurationError struct {
	LeaderboardPublicID string
	DurationInSeconds   int64
}

InvalidDurationError identifies that a given key generates an invalid duration

func (*InvalidDurationError) Error

func (e *InvalidDurationError) Error() string

type LeaderboardExpiredError

type LeaderboardExpiredError struct {
	LeaderboardPublicID string
}

LeaderboardExpiredError identifies that a given key generates an already expired leaderboard

func (*LeaderboardExpiredError) Error

func (e *LeaderboardExpiredError) Error() string

Jump to

Keyboard shortcuts

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