utils

package
v0.0.0-...-feac726 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectToDatabase

func ConnectToDatabase(connection string, maxAttempts int) (*sqlx.DB, error)

func GetPlayerAvatar

func GetPlayerAvatar(player *models.Player) error

func GetPlayerInfo

func GetPlayerInfo(player *models.Player) error

func GetPlayerTier

func GetPlayerTier(player *models.Player) error

func NowAsUnixMilliseconds

func NowAsUnixMilliseconds() int64

func ValidateToken

func ValidateToken(username string, token string) error

Types

type PlayerAvatarResponse

type PlayerAvatarResponse struct {
	Large string `json:"large"`
}

type PlayerInfoResponse

type PlayerInfoResponse struct {
	PlayerInfo struct {
		OldGold    bool   `json:"old_gold"`
		Registered string `json:"registered"`
		Role       int64  `json:"role"`
	} `json:"playerInfo"`
}

type PlayerTierResponse

type PlayerTierResponse struct {
	PlayerTier struct {
		Tier int64 `json:"tier"`
	} `json:"playerTier"`
}

Jump to

Keyboard shortcuts

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