models

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserCacheTTL         = 24 * time.Hour
	ContestsCacheTTL     = 12 * time.Hour
	SyncedEventsCacheTTL = 24 * time.Hour
	PlatformsCacheTTL    = 24 * time.Hour
)

Variables

This section is empty.

Functions

func ContestsCacheKey added in v1.2.0

func ContestsCacheKey(platform string) string

func PlatformsCacheKey added in v1.4.6

func PlatformsCacheKey() string

func SyncedEventsCacheKey added in v1.4.6

func SyncedEventsCacheKey(userID int) string

func UserCacheKey added in v1.2.0

func UserCacheKey(userID int) string

Types

type CachedUser added in v1.2.0

type CachedUser struct {
	ID           int      `json:"id"`
	GoogleID     string   `json:"google_id"`
	Email        string   `json:"email"`
	RefreshToken string   `json:"refresh_token"`
	CalendarID   string   `json:"calendar_id"`
	UseDedicated bool     `json:"use_dedicated"`
	Platforms    []string `json:"platforms"`
}

type Contest

type Contest struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	URL       string    `json:"url"`
	StartTime time.Time `json:"start_time"`
	EndTime   time.Time `json:"end_time"`
	Duration  int       `json:"duration"`
	Platform  string    `json:"platform"`
	UpdatedAt time.Time `json:"updated_at"`
}

type SyncedEvent

type SyncedEvent struct {
	UserID        int       `json:"user_id"`
	ContestID     string    `json:"contest_id"`
	GoogleEventID string    `json:"google_event_id"`
	SyncedAt      time.Time `json:"synced_at"`
}

type User

type User struct {
	ID           int       `json:"id"`
	GoogleID     string    `json:"google_id"`
	Email        string    `json:"email"`
	RefreshToken string    `json:"-"`
	CalendarID   string    `json:"calendar_id"`
	UseDedicated bool      `json:"use_dedicated"`
	Platforms    []string  `json:"platforms"`
	CreatedAt    time.Time `json:"created_at"`
}

type UserPlatformPreference

type UserPlatformPreference struct {
	UserID   int    `json:"user_id"`
	Platform string `json:"platform"`
}

Jump to

Keyboard shortcuts

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