utils

package
v0.0.0-...-1ca80e3 Latest Latest
Warning

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

Go to latest
Published: May 23, 2025 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DiscordSaveWebhookURL  string
	DiscordStatsWebhookURL string
)
View Source
var SteamAPIKey string

Functions

func AuthenticateUserTicket

func AuthenticateUserTicket(ticket string) (common.UserTicketInfo, error)

func GetPlayerSummaries

func GetPlayerSummaries(steamids ...string) ([]common.PlayerSummaryInfo, error)

func SendDiscordMessage

func SendDiscordMessage(url string, data DiscordWebhookRequest) error

func UnBinHex

func UnBinHex(s string) []byte

func UnBinHexString

func UnBinHexString(s string) string

func ValidateKey

func ValidateKey(data string) bool

validates the key in toybox api calls

func WriteError

func WriteError(w http.ResponseWriter, r *http.Request, message string)

Types

type AuthenticateUserTicketResponse

type AuthenticateUserTicketResponse struct {
	Response struct {
		Params common.UserTicketInfo `json:"params"`
		Error  struct {
			ErrorCode int    `json:"errorcode"`
			ErrorDesc string `json:"errordesc"`
		} `json:"error"`
	} `json:"response"`
}

type DiscordWebhookEmbed

type DiscordWebhookEmbed struct {
	Title       string                    `json:"title"`
	Description string                    `json:"description"`
	Color       int                       `json:"color"`
	Author      DiscordWebhookEmbedAuthor `json:"author"`
	Image       DiscordWebhookEmbedImage  `json:"image"`
}

type DiscordWebhookEmbedAuthor

type DiscordWebhookEmbedAuthor struct {
	Name    string `json:"name"`
	IconURL string `json:"icon_url"`
}

type DiscordWebhookEmbedImage

type DiscordWebhookEmbedImage struct {
	URL string `json:"url"`
}

type DiscordWebhookRequest

type DiscordWebhookRequest struct {
	Embeds          []DiscordWebhookEmbed `json:"embeds"`
	AllowedMentions struct {
		Parse []string `json:"parse"`
	} `json:"allowed_mentions"`
}

type GetPlayerSummariesResponse

type GetPlayerSummariesResponse struct {
	Response struct {
		Players []common.PlayerSummaryInfo `json:"players"`
	} `json:"response"`
}

Jump to

Keyboard shortcuts

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