utils

package
v0.0.0-...-ce4f20c Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFormat

func CheckFormat(solve string) bool

returns true if the format is ok, eg. not >= 60 seconds, not >= 60 minutes, ... otherwise returns false

func CompareSolves

func CompareSolves(t1 *int, s2 string, isfmc bool, scramble string)

func CreateToken

func CreateToken(userid int, secretKey string, expiresInSeconds int) (string, error)

func DOES_NOT_WORK_CURRENTLY_FOR_SOME_REASON_GetWorldRecords

func DOES_NOT_WORK_CURRENTLY_FOR_SOME_REASON_GetWorldRecords(eventName string) (int, int, error)

func FormatMultiTime

func FormatMultiTime(timeInMiliseconds int) string

func FormatMultiTimes

func FormatMultiTimes(solves []string) []string

func FormatTime

func FormatTime(timeInMiliseconds int, isfmc bool) string

func GetContinents

func GetContinents(db *pgxpool.Pool) ([]string, error)

func GetCountries

func GetCountries(db *pgxpool.Pool) ([]string, error)

func GetNoOfSolves

func GetNoOfSolves(format string) (int, error)

func GetScramblesByResultEntryId

func GetScramblesByResultEntryId(db *pgxpool.Pool, eid int, cid string) ([]string, error)

func GetSolve

func GetSolve(solve string, isfmc bool, scramble string) string

func GetWorldRecords

func GetWorldRecords(eventName string) (int, int, error)

func IsFMC

func IsFMC(eventiconcode string) bool

func LeftPad

func LeftPad(s string, cnt int, ch string) string

func NextMonday

func NextMonday() time.Time

func ParseMultiToMilliseconds

func ParseMultiToMilliseconds(s string) int

func ParseSolveToMilliseconds

func ParseSolveToMilliseconds(s string, isfmc bool, scramble string) int

func PlaceFromDotToEnglish

func PlaceFromDotToEnglish(from string) string

endsWith: 1. to 1st, 2. to 2nd, 3. to 3rd, 4-9. to 4-9th, ... except: 11-19. to 11-19th

func RandSeq

func RandSeq(n int) string

func RegenerateImageForScramble

func RegenerateImageForScramble(
	db *pgxpool.Pool,
	scrambleId int,
	scramble string,
	scramblingcode string,
) (string, error)

func Reverse

func Reverse[S ~[]E, E any](s S)

func SaveScrambleImg

func SaveScrambleImg(img_id string, svg_content string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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