domain

package
v0.0.0-...-9bee2a0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoleMark    = "mark"
	RoleAthlete = "athlete"
	RoleManager = "manager"
	RoleUnknown = "unknown"
)
View Source
const FirstMarkNo = 1

Variables

This section is empty.

Functions

func CalcNextMarkNo

func CalcNextMarkNo(wantMarkCounts int, passedMarkNo int) int

func CalcPreviousMarkNo

func CalcPreviousMarkNo(wantMarkCounts int, passedMarkNo int) int

func CreateDeviceID

func CreateDeviceID(role string, athleteNo int) string

func RetrieveRoleAndMarkNo

func RetrieveRoleAndMarkNo(deviceID string) (string, int, bool)

func SeparateDeviceIDByRole

func SeparateDeviceIDByRole(deviceIDs []string) ([]string, []string, []string, []string)

func ValidateDeviceID

func ValidateDeviceID(deviceID string) bool

Types

type Association

type Association struct {
	ID           string    `json:"id"`
	Name         string    `json:"name"`
	ContractType string    `json:"contract_type"`
	ExpiresAt    time.Time `json:"expires_at"`
}

type ContractType

type ContractType string
const (
	ThreeMonthContract ContractType = "3month"
	OneYearContract    ContractType = "1year"
	ThreeYearContract  ContractType = "3year"
	FiveYearContract   ContractType = "5year"
	FreeContract       ContractType = "free"
)

func (ContractType) Duration

func (ct ContractType) Duration() time.Duration

type Race

type Race struct {
	AssociationID string      `json:"association_id"`
	Name          string      `json:"name"`
	Started       bool        `json:"started"`
	StartedAt     time.Time   `json:"started_at"`
	FinishedAt    time.Time   `json:"finished_at"`
	Association   Association `json:"association"`
	AthleteIDs    []string    `json:"athlete_ids"`
	MarkIDs       []string    `json:"mark_ids"`
}

Jump to

Keyboard shortcuts

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