helpers

package
v0.0.0-...-a97d171 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: GPL-3.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppIconBase    = "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/" // Also the base for achievements
	DefaultAppIcon = "/assets/img/no-app-image-square.jpg"
)
View Source
const (
	AvatarBase = "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/"

	GroupTypeGame  = "game"
	GroupTypeGroup = "group"
)
View Source
const (
	Date          = "02 Jan"
	DateTime      = "02 Jan 15:04"
	DateYear      = "02 Jan 2006"
	DateYearTime  = "02 Jan 06 15:04"
	DateSQL       = "2006-01-02 15:04:05"
	DateSQLMinute = "2006-01-02 15:04"
	DateSQLDay    = "2006-01-02"
)
View Source
const (
	DefaultPlayerAvatar = "/assets/img/no-player-image.jpg"
)
View Source
const Letters = "abcdefghijklmnopqrstuvwxyz"
View Source
const LettersCaps = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
View Source
const Numbers = "0123456789"

Variables

View Source
var (
	RegexAlpha                 = regexp.MustCompile(`[a-zA-Z]+`)
	RegexInts                  = regexp.MustCompile(`[0-9]+`)
	RegexIntsCommas            = regexp.MustCompile(`[0-9,]+`)
	RegexIntsOnly              = regexp.MustCompile(`^[0-9]+$`)
	RegexMD5Only               = regexp.MustCompile(`^[a-f0-9]{32}$`)
	RegexSha1                  = regexp.MustCompile(`[a-f0-9]{40}`)
	RegexSha1Only              = regexp.MustCompile(`^[a-f0-9]{40}$`)
	RegexTimestamps            = regexp.MustCompile(`1[0-9]{9}`)
	RegexNonInts               = regexp.MustCompile(`[^0-9]+`)
	RegexNonNumbers            = regexp.MustCompile(`[^0-9-]+`)
	RegexNonAlphaNumeric       = regexp.MustCompile(`[^a-zA-Z0-9]+`)
	RegexNonAlphaNumericSpace  = regexp.MustCompile(`[^a-zA-Z0-9 ]+`)
	RegexNewLines              = regexp.MustCompile(`[\n\r]{3,}`)
	RegexNewLine               = regexp.MustCompile(`[\n\r]`)
	RegexSpaces                = regexp.MustCompile(`[\s]`)
	RegexSpacesStartEnd        = regexp.MustCompile(`^[\s\n\r]+|[\s\n\r]+$`)
	RegexFilterEmptyCharacters = regexp.MustCompile(`[\p{Cf}\p{Co}\p{Cs}\p{Cc}\p{C}\p{Braille}]`)
	RegexSmallRomanOnly        = regexp.MustCompile(`^[IVX]+$`)
	RegexYouTubeID             = regexp.MustCompile(`[a-zA-Z0-9_\-]{11}`)
	RegexIP                    = regexp.MustCompile(`(?:[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})`)
	RegexOrdinals              = regexp.MustCompile(`[0-9]st|[0-9]nd|[0-9]rd|[0-9]th`)
)

noinspection GoUnusedGlobalVariable

View Source
var BBCodeCompiler = bbcode.NewCompiler(true, true)
View Source
var BuiltInEventBadges = map[int]BuiltInbadge{
	245070:  {BadgeID: 1, AppID: 245070, Icon: "30a5de112a3512269cbc3d428fad3b9c507c56ba", Name: "2013: Summer Getaway"},
	267420:  {BadgeID: 1, AppID: 267420, Icon: "e041163b0c4d5cba61fb54612973612636cdd970", Name: "2013: Holdiay Sale"},
	303700:  {BadgeID: 1, AppID: 303700, Icon: "b3c3fa2821b32ce6bcc127e5ee3ec47845c35308", Name: "2014: Summer Adventure"},
	335590:  {BadgeID: 1, AppID: 335590, Icon: "b1c504dfaf4d073e5cf9c2d7d48c55c9cf11b7d3", Name: "2014: Holdiay Sale"},
	368020:  {BadgeID: 1, AppID: 368020, Icon: "49715c47e076456e0aacec76a5a0d714cadea951", Name: "2015: Monster Summer Sale"},
	425280:  {BadgeID: 1, AppID: 425280, Icon: "3442d0c36e5d549abf29872c9aec9f6e4364d23f", Name: "2015: Holdiay Sale"},
	480730:  {BadgeID: 1, AppID: 480730, Icon: "6b1280c07eedafdb3d9cac282f82da4365b9c98d", Name: "2016: Summer Sale"},
	566020:  {BadgeID: 1, AppID: 566020, Icon: "604be0b040a1117a5b8b5579b3c6ec25e540f458", Name: "2016: Steam Awards"},
	639900:  {BadgeID: 1, AppID: 639900, Icon: "9dd59323d14eb5dba94328db80e27caaee4c29ea", Name: "2017: Summer Sale"},
	762800:  {BadgeID: 1, AppID: 762800, Icon: "0a10b3b3725de8f72cb48fd94daff296cc3dfe52", Name: "2017: Steam Awards"},
	876740:  {BadgeID: 1, AppID: 876740, Icon: "9c677484f7f148045189a9dabe7efdf733e9e1f1", Name: "2018: Intergalactic Summer"},
	991980:  {BadgeID: 1, AppID: 991980, Icon: "3c96df81a7f82f23b68356c51733793cdece8f63", Name: "2018: Winter Sale"},
	1195670: {BadgeID: 1, AppID: 1195670, Icon: "581a14e34100d7f4955ceff9365a7e40a89b57c8", Name: "2019: Winter Sale"},
	1263950: {BadgeID: 1, AppID: 1263950, Icon: "24a62a6fa825d6b0a174675fb97a01e9df81d030", Name: "2020: The Debut Collection"},
	1343890: {BadgeID: 1, AppID: 1343890, Icon: "89bf983bd41c23c8e4f4e24155e995e770e51070", Name: "2020: Summer Road Trip"},
	1465680: {BadgeID: 1, AppID: 1465680, Icon: "64f30989f0794a5437b4b501eb932b2f119616ae", Name: "2020: Winter Sale"},
	1492660: {BadgeID: 1, AppID: 1492660, Icon: "526005d8e2862a721f0079c52eb422fa2f293344", Name: "2020: Winter Collection"},
	1615900: {BadgeID: 1, AppID: 1615900, Icon: "093e0e79264e9e249cc7a0c24c0151da7c2af379", Name: "2021: Spring Collection"},
}
View Source
var BuiltInSpecialBadges = map[int]BuiltInbadge{

	1:  {BadgeID: 1, Icon: "02_years/steamyears1_80.png", Name: "Years of Service"},
	2:  {BadgeID: 2, Icon: "01_community/community03_80.png", Name: "Community Ambassador"},
	3:  {BadgeID: 3, Icon: "03_potato/potato03_80.png", Name: "The Potato Sack"},
	4:  {BadgeID: 4, Icon: "04_treasurehunt/treasurehunt03_80.png", Name: "The Great Steam Treasure Hunt"},
	5:  {BadgeID: 5, Icon: "05_summer2011/tickets80.png", Name: "Steam Summer Camp"},
	6:  {BadgeID: 6, Icon: "06_winter2011/coal03_80.png", Name: "Steam Holiday Sale 2011"},
	7:  {BadgeID: 7, Icon: "07_summer2012/Summer2012_stage3_80.png", Name: "Steam Summer Sale 2012"},
	8:  {BadgeID: 8, Icon: "08_winter2012/winter2012_badge80.png", Name: "Steam Holiday Sale 2012"},
	9:  {BadgeID: 9, Icon: "09_communitytranslator/translator_level4_80.png", Name: "Steam Community Translator"},
	10: {BadgeID: 10, Icon: "generic/CommunityModerator_80.png", Name: "Steam Community Moderator"},
	11: {BadgeID: 11, Icon: "generic/ValveEmployee_80.png", Name: "Valve Employee"},
	12: {BadgeID: 12, Icon: "generic/GameDeveloper_80.png", Name: "Steamworks Developer"},
	13: {BadgeID: 13, Icon: "13_gamecollector/25000_80.png", Name: "Owned Games"},
	14: {BadgeID: 14, Icon: "generic/TradingCardBeta_80.png", Name: "Trading Card Beta Tester"},
	15: {BadgeID: 15, Icon: "15_hwbeta/hwbeta03_80.png", Name: "Steam Hardware Beta"},
	16: {BadgeID: 16, Icon: "16_summer2014/team_red.png", Name: "Steam Summer Adventure 2014 - Red Team"},
	17: {BadgeID: 17, Icon: "16_summer2014/team_blue.png", Name: "Steam Summer Adventure 2014 - Blue Team"},
	18: {BadgeID: 18, Icon: "16_summer2014/team_pink.png", Name: "Steam Summer Adventure 2014 - Pink Team"},
	19: {BadgeID: 19, Icon: "16_summer2014/team_green.png", Name: "Steam Summer Adventure 2014 - Green Team"},
	20: {BadgeID: 20, Icon: "16_summer2014/team_purple.png", Name: "Steam Summer Adventure 2014 - Purple Team"},
	21: {BadgeID: 21, Icon: "21_auction/winner_80.png?v=2", Name: "Auction Participant/Winner"},
	22: {BadgeID: 22, Icon: "22_golden/owner_80.png", Name: "2014 Holiday Profile Recipient"},
	23: {BadgeID: 23, Icon: "23_towerattack/wormhole.png", Name: "Monster Summer"},
	24: {BadgeID: 24, Icon: "24_winter2015_arg_red_herring/red_herring.png", Name: "Red Herring"},
	25: {BadgeID: 25, Icon: "25_steamawardnominations/level04_80.png", Name: "Steam Awards Nomination Committee 2016"},
	26: {BadgeID: 26, Icon: "26_summer2017_sticker/completionist.png", Name: "Sticker Completionist"},
	27: {BadgeID: 27, Icon: "27_steamawardnominations/level04_80.png", Name: "Steam Awards Nomination Committee 2017"},
	28: {BadgeID: 28, Icon: "28_springcleaning2018/gold_80.png", Name: "Spring Cleaning Event 2018"},
	29: {BadgeID: 29, Icon: "29_salien/6_80.png", Name: "Salien"},
	30: {BadgeID: 30, Icon: "generic/RetiredModerator_80.png", Name: "Retired Community Moderator"},
	31: {BadgeID: 31, Icon: "30_steamawardnominations/level04_80.png", Name: "Steam Awards Nomination Committee 2018"},
	32: {BadgeID: 32, Icon: "generic/ValveEmployee_80.png", Name: "Valve Moderator"},
	33: {BadgeID: 33, Icon: "33_cozycottage2018/1000000_80.png", Name: "Winter 2018 Knick-Knack Collector"},
	34: {BadgeID: 34, Icon: "34_lny2019/10_80.png", Name: "Lunar New Year 2019"},
	35: {BadgeID: 34, Icon: "https://steamcommunity-a.akamaihd.net/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxH5rd9eDAjcFyv45SRYAFMIcKL_PArgVSL403ulRUWEndVKv8h56EAgQkalZSsuOnegRm1aqed2oStIXlkIHez6aiNe6CkzIAuJcgiLGU8I6kjgz6ux07-Ytsxtc/96fx96f", Name: "Lunar New Year 2019 Golden Profile"},
	36: {BadgeID: 36, Icon: "36_springcleaning2019/gold_80x80.png", Name: "Spring Cleaning Event 2019"},
	37: {BadgeID: 37, Icon: "37_summer2019/level1000000_80.png", Name: "Steam Grand Prix 2019"},
	38: {BadgeID: 38, Icon: "37_summer2019/hare_gold_80.png", Name: "Steam Grand Prix 2019 - Team Hare"},
	39: {BadgeID: 39, Icon: "37_summer2019/tortoise_gold_80.png", Name: "Steam Grand Prix 2019 - Team Tortoise"},
	40: {BadgeID: 40, Icon: "37_summer2019/corgi_gold_80.png", Name: "Steam Grand Prix 2019 - Team Corgi"},
	41: {BadgeID: 41, Icon: "37_summer2019/cockatiel_gold_80.png", Name: "Steam Grand Prix 2019 - Team Cockatiel"},
	42: {BadgeID: 42, Icon: "37_summer2019/pig_gold_80.png", Name: "Steam Grand Prix 2019 - Team Pig"},
	43: {BadgeID: 43, Icon: "43_steamawardnominations/level04_80.png", Name: "Steam Awards Nomination Committee 2019"},
	44: {BadgeID: 44, Icon: "44_winter2019/level15_80.png", Name: "Winter Sale 2019"},
	45: {BadgeID: 45, Icon: "45_steamville2019/key_to_city_80.png", Name: "Steamville 2019"},
	46: {BadgeID: 46, Icon: "46_lny2020/10_80.png", Name: "Lunar New Year 2020"},
	47: {BadgeID: 47, Icon: "47_springcleaning2020/dewey_badge_3.0_80x80.png", Name: "Spring Cleaning Event 2020"},
	48: {BadgeID: 48, Icon: "48_communitycontributor/1_80.png", Name: "Community Contributor"},
	49: {BadgeID: 49, Icon: "49_communitypatron/1_80.png", Name: "Community Patron"},
	50: {BadgeID: 50, Icon: "50_steamawardnominations/level04_80.png", Name: "Steam Award Nominations"},
}
View Source
var ErrInvalidGroupID = errors.New("invalid group id")
View Source
var ErrNon200 = errors.New("server responded with error")
View Source
var ErrUnMarshalNonPointer = errors.New("trying to unmarshal a non-pointer")
View Source
var LastUpdatedQuery = bson.D{
	{"community_visibility_state", 3},
	{"removed", false},
}

Just here so frontend can use it

View Source
var PlayerRankFields = map[string]RankMetric{
	"level":                  RankKeyLevel,
	"games_count":            RankKeyGames,
	"badges_count":           RankKeyBadges,
	"badges_foil_count":      RankKeyBadgesFoil,
	"play_time":              RankKeyPlaytime,
	"achievement_count":      RankKeyAchievements,
	"awards_given_points":    RankKeyAwardsGiven,
	"awards_received_points": RankKeyAwardsReceived,
}

Mongo col -> Rank key

Rank key -> Influx col

Functions

func Avg

func Avg(vars ...float64) float64

func ChunkInt64s

func ChunkInt64s(ints []int64, n int) (chunks [][]int64)

func ChunkInts

func ChunkInts(ints []int, n int) (chunks [][]int)

func ChunkStrings

func ChunkStrings(strings []string, n int) (chunks [][]string)

func Close

func Close(closer io.Closer)

func Delete

func Delete(link string, timeout time.Duration, headers http.Header) (b []byte, code int, err error)

func Filter

func Filter(ss []string, filter func(string) bool) (ret []string)

func FindArticleImage

func FindArticleImage(body string) string

func FirstInts

func FirstInts(slice []int, x int) []int

func FlattenMap

func FlattenMap(m map[string]interface{}) map[string]interface{}

func FloatToString

func FloatToString(f float64, decimals int) string

keeps extra zeros

func FormatJSON

func FormatJSON(unformatted string) (formatted string, err error)

func Get

func Get(link string, timeout time.Duration, headers http.Header) (b []byte, code int, err error)

func GetAchievementCompleted

func GetAchievementCompleted(f float64) string

func GetAchievementIcon

func GetAchievementIcon(appID int, icon string) string

func GetAppArticleFeedName

func GetAppArticleFeedName(id, name string) string
func GetAppCommunityLink(appID int) string

func GetAppFollowers

func GetAppFollowers(groupID string, followers int) string

func GetAppHeaderImage

func GetAppHeaderImage(appID int) string

func GetAppIcon

func GetAppIcon(id int, icon string) string

func GetAppIconAbsolute

func GetAppIconAbsolute(id int, icon string) string

func GetAppName

func GetAppName(id int, name string) string

func GetAppPath

func GetAppPath(id int, name string) string

func GetAppPathAbsolute

func GetAppPathAbsolute(id int, name string) string
func GetAppPlayLink(appID int) template.URL

func GetAppReleaseDateNice

func GetAppReleaseDateNice(releaseDateOriginal int64, releaseDateSteam int64, releaseDate string) string

func GetAppReleaseState

func GetAppReleaseState(state string) (ret string)

func GetAppReviewScore

func GetAppReviewScore(score float64) string
func GetAppStoreLink(appID int) string

func GetAppType

func GetAppType(appType string) (ret string)

func GetArticleBody

func GetArticleBody(body string) template.HTML

func GetArticleIcon

func GetArticleIcon(articleIcon string, appID int, appIcon string) string

func GetBadgeIcon

func GetBadgeIcon(icon string, appID int, badgeID int) string

func GetBadgeName

func GetBadgeName(badgeName string, uniqueID int) string

func GetBadgePath

func GetBadgePath(badgeName string, appID int, badgeID int, foil bool) string

func GetBadgeUniqueID

func GetBadgeUniqueID(appID int, badgeID int) int

func GetBundleName

func GetBundleName(id int, name string) string

func GetBundlePath

func GetBundlePath(id int, name string) string

func GetBundlePricesFormatted

func GetBundlePricesFormatted(prices map[steamapi.ProductCC]int) (ret map[steamapi.ProductCC]string)
func GetBundleStoreLink(id int) string

func GetDaysToRelease

func GetDaysToRelease(unix int64) string

func GetGroupAbbreviation

func GetGroupAbbreviation(name string) string

func GetGroupIcon

func GetGroupIcon(icon string) string
func GetGroupLink(typex string, url string) string

func GetGroupName

func GetGroupName(id string, name string) string

func GetGroupPath

func GetGroupPath(id string, name string) string

func GetGroupPathAbsolute

func GetGroupPathAbsolute(id string, name string) string

func GetGroupType

func GetGroupType(typex string) string

func GetHashTag

func GetHashTag(string string) (ret string)

func GetIP

func GetIP() string

func GetPackageName

func GetPackageName(id int, name string) string

func GetPackagePath

func GetPackagePath(id int, name string) string

func GetPlayerAvatar

func GetPlayerAvatar(avatar string) string

184 x 184

func GetPlayerAvatar2

func GetPlayerAvatar2(level int) string

Steam's generated avatar

func GetPlayerAvatarAbsolute

func GetPlayerAvatarAbsolute(avatar string) string
func GetPlayerCommunityLink(playerID int64) string

Just use ID in case slug has changed

func GetPlayerFlagPath

func GetPlayerFlagPath(code string) string

func GetPlayerMaxFriends

func GetPlayerMaxFriends(level int) (ret int)

func GetPlayerName

func GetPlayerName(id int64, name string) string

func GetPlayerPath

func GetPlayerPath(id int64, name string) string

func GetPlayerPathAbsolute

func GetPlayerPathAbsolute(id int64, name string) string

func GetReleaseDateUnix

func GetReleaseDateUnix(date string) int64

func GetStatPath

func GetStatPath(p string, id int, name string) string

func GetTimeLong

func GetTimeLong(minutes int, max int) (ret string)

func GetTimeShort

func GetTimeShort(minutes int, max int) (ret string)

func GetTrendValue

func GetTrendValue(i float64) string
func Head(link string, timeout time.Duration) (code int, err error)

func IgnoreErrors

func IgnoreErrors(err error, errs ...error) error

IgnoreErrors returns nil if an error is of one of the provided types, returns the provided error otherwise.

func Int32sToInts

func Int32sToInts(s []int32) (o []int)

func IntSliceToStringSlice

func IntSliceToStringSlice(in []int) (ret []string)

func IntsToInt32s

func IntsToInt32s(s []int) (o []int32)

func IsBadgeEvent

func IsBadgeEvent(appID int) bool

func IsBadgeGame

func IsBadgeGame(appID int) bool

func IsBadgeSpecial

func IsBadgeSpecial(appID int) bool

Dont input a unique ID

func IsBot

func IsBot(userAgent string) bool

func IsGroupOfficial

func IsGroupOfficial(typex string) bool

func IsJSON

func IsJSON(str string) bool

func IsValidAppID

func IsValidAppID(id int) bool

func IsValidGroupID

func IsValidGroupID(id string) (string, error)

func IsValidPackageID

func IsValidPackageID(id int) bool

func IsValidPlayerID

func IsValidPlayerID(id int64) (int64, error)

func JoinInt64s

func JoinInt64s(i []int64, sep string) string

func JoinInts

func JoinInts(i []int, sep string) string

func KeepAlive

func KeepAlive(callbacks ...func())

func MD5

func MD5(b []byte) string

func MD5Interface

func MD5Interface(i interface{}) string

func MarshalUnmarshal

func MarshalUnmarshal(in interface{}, out interface{}) (err error)

func Max

func Max(vars ...float64) float64

func Min

func Min(vars ...float64) float64

func OrdinalComma

func OrdinalComma(i int) string

func OutputBundleForJSON

func OutputBundleForJSON(bundle Bundle) []interface{}

func PercentageChange

func PercentageChange(old, new int) (delta float64)

func Post

func Post(link string, data url.Values, headers http.Header) (b []byte, code int, err error)

func RandString

func RandString(n int, chars string) string

func RenderHTMLAndBBCode

func RenderHTMLAndBBCode(in string) template.HTML

func RoundFloatTo1DP

func RoundFloatTo1DP(f float64) float64

func RoundFloatTo2DP

func RoundFloatTo2DP(f float64) float64

func RoundIntTo2DP

func RoundIntTo2DP(i int) float64

func RoundTo

func RoundTo(x, unit float64) float64

func ShortHandNumber

func ShortHandNumber(i int64) string

func ShuffleInt64s

func ShuffleInt64s(slice []int64) []int64

func SliceHasInt

func SliceHasInt(slice []int, i int) bool

func SliceHasInt64

func SliceHasInt64(slice []int64, i int64) bool

func SliceHasString

func SliceHasString(i string, slice []string) bool

func StringPointer

func StringPointer(s string) *string

func StringSliceToInt64Slice

func StringSliceToInt64Slice(in []string) (ret []int64)

func StringSliceToIntSlice

func StringSliceToIntSlice(in []string) (ret []int)

func StringToInt

func StringToInt(s string) int

func StringToSlice

func StringToSlice(s string, glue string) (ret []string)

func StringsToInterfaces

func StringsToInterfaces(s []string) (o []interface{})

func TruncateString

func TruncateString(str string, size int, tail string) string

func UniqueInt64

func UniqueInt64(arg []int64) []int64

func UniqueString

func UniqueString(strings []string) []string

func Unmarshal

func Unmarshal(data []byte, v interface{}) (err error)

Wraps json.Unmarshal and adds logging

func UnmarshalStrict

func UnmarshalStrict(data []byte, v interface{}) error

Types

type AppImage

type AppImage struct {
	PathFull      string `json:"f"`
	PathThumbnail string `json:"t"`
}

type AppReview

type AppReview struct {
	Review     string `json:"r"`
	Vote       bool   `json:"v"`
	VotesGood  int    `json:"g"`
	VotesFunny int    `json:"f"`
	Created    string `json:"c"`
	PlayerPath string `json:"p"`
	PlayerName string `json:"n"`
}

func (AppReview) GetReview

func (ar AppReview) GetReview() template.HTML

type AppReviewSummary

type AppReviewSummary struct {
	Positive int
	Negative int
	Reviews  []AppReview
}

func (AppReviewSummary) GetNegativePercent

func (r AppReviewSummary) GetNegativePercent() float64

func (AppReviewSummary) GetPositivePercent

func (r AppReviewSummary) GetPositivePercent() float64

func (AppReviewSummary) GetTotal

func (r AppReviewSummary) GetTotal() int

type AppStat

type AppStat struct {
	Name        string `json:"n"`
	Default     int    `json:"d"`
	DisplayName string `json:"o"`
}

type AppSteamSpy

type AppSteamSpy struct {
	SSAveragePlaytimeTwoWeeks int `json:"aw"`
	SSAveragePlaytimeForever  int `json:"af"`
	SSMedianPlaytimeTwoWeeks  int `json:"mw"`
	SSMedianPlaytimeForever   int `json:"mf"`
	SSOwnersLow               int `json:"ol"`
	SSOwnersHigh              int `json:"oh"`
}

func (AppSteamSpy) GetSSAveragePlaytimeForever

func (ss AppSteamSpy) GetSSAveragePlaytimeForever() float64

func (AppSteamSpy) GetSSAveragePlaytimeTwoWeeks

func (ss AppSteamSpy) GetSSAveragePlaytimeTwoWeeks() float64

func (AppSteamSpy) GetSSMedianPlaytimeForever

func (ss AppSteamSpy) GetSSMedianPlaytimeForever() float64

func (AppSteamSpy) GetSSMedianPlaytimeTwoWeeks

func (ss AppSteamSpy) GetSSMedianPlaytimeTwoWeeks() float64

type AppVideo

type AppVideo struct {
	PathFull      string `json:"f"`
	PathThumbnail string `json:"s"`
	Title         string `json:"t"`
}

func (AppVideo) Micro

func (video AppVideo) Micro() string

type Bits

type Bits uint8

func (*Bits) ClearFlag

func (f *Bits) ClearFlag(flag Bits)

noinspection GoUnusedExportedFunction

func (Bits) Has

func (f Bits) Has(flag Bits) bool

func (*Bits) Set

func (f *Bits) Set(flag Bits)

func (*Bits) ToggleFlag

func (f *Bits) ToggleFlag(flag Bits)

noinspection GoUnusedExportedFunction

type BuiltInbadge

type BuiltInbadge struct {
	AppID   int
	BadgeID int
	Name    string
	Icon    string
}

func (BuiltInbadge) GetIcon

func (badge BuiltInbadge) GetIcon() string

func (BuiltInbadge) GetName

func (badge BuiltInbadge) GetName() string

func (BuiltInbadge) GetPath

func (badge BuiltInbadge) GetPath(foil bool) string

func (BuiltInbadge) ID

func (badge BuiltInbadge) ID() int

func (BuiltInbadge) IsSpecial

func (badge BuiltInbadge) IsSpecial() bool

type Bundle

type Bundle interface {
	OutputForJSON() (output []interface{})
	GetName() string
	GetPath() string
	GetStoreLink() string
	GetID() int
	GetUpdated() time.Time
	GetCreated() time.Time
	GetDiscount() int
	GetDiscountSale() int
	GetDiscountHighest() int
	GetPrices() map[steamapi.ProductCC]int
	GetPricesFormatted() map[steamapi.ProductCC]string
	GetPricesSaleFormatted() map[steamapi.ProductCC]string
	GetScore() float64
	GetType() string
	GetApps() int
	GetPackages() int
	IsGiftable() bool
}

type ProductInterface

type ProductInterface interface {
	GetID() int
	GetProductType() ProductType
	GetName() string
	GetIcon() string
	GetPrices() (prices ProductPrices)
	GetPath() string
	GetType() string
}

type ProductPrice

type ProductPrice struct {
	Exists          bool                  `json:"-" bson:"-"`
	Currency        steamapi.CurrencyCode `json:"currency"`
	Initial         int                   `json:"initial"`
	Final           int                   `json:"final"`
	DiscountPercent int                   `json:"discount_percent"`
	Individual      int                   `json:"individual"`
	Free            bool                  `json:"free"`
}

func (ProductPrice) GetCountryName

func (p ProductPrice) GetCountryName(code steamapi.ProductCC) string

func (ProductPrice) GetDiscountPercent

func (p ProductPrice) GetDiscountPercent() string

func (ProductPrice) GetFinal

func (p ProductPrice) GetFinal() string

func (ProductPrice) GetFlag

func (p ProductPrice) GetFlag(code steamapi.ProductCC) string

func (ProductPrice) GetIndividual

func (p ProductPrice) GetIndividual() string

func (ProductPrice) GetInitial

func (p ProductPrice) GetInitial() string

type ProductPrices

type ProductPrices map[steamapi.ProductCC]ProductPrice

func (*ProductPrices) AddPriceFromApp

func (p *ProductPrices) AddPriceFromApp(code steamapi.ProductCC, prices steamapi.AppDetails)

func (*ProductPrices) AddPriceFromPackage

func (p *ProductPrices) AddPriceFromPackage(code steamapi.ProductCC, prices steamapi.PackageDetailsBody)

func (ProductPrices) Get

func (p ProductPrices) Get(code steamapi.ProductCC) (price ProductPrice)

func (ProductPrices) Map

func (p ProductPrices) Map() (prices map[steamapi.ProductCC]int)

func (ProductPrices) MapDiscountedFormatted

func (p ProductPrices) MapDiscountedFormatted() (prices map[steamapi.ProductCC]string)

func (ProductPrices) MapFormatted

func (p ProductPrices) MapFormatted() (prices map[steamapi.ProductCC]string)

type ProductType

type ProductType uint8
const (
	ProductTypeApp ProductType = iota
	ProductTypePackage
)

func (ProductType) String

func (pt ProductType) String() string

type RankMetric

type RankMetric string
const (
	RankKeyLevel          RankMetric = "l"
	RankKeyBadges         RankMetric = "b"
	RankKeyBadgesFoil     RankMetric = "d"
	RankKeyGames          RankMetric = "g"
	RankKeyPlaytime       RankMetric = "p"
	RankKeyAchievements   RankMetric = "a"
	RankKeyAwardsGiven    RankMetric = "c"
	RankKeyAwardsReceived RankMetric = "e"
)

Must be single character

func (RankMetric) Letter

func (rk RankMetric) Letter() string

func (RankMetric) String

func (rk RankMetric) String() string

type SystemRequirement

type SystemRequirement struct {
	Key string
	Val string
}

func (SystemRequirement) Format

func (sr SystemRequirement) Format() template.HTML

type Tuple

type Tuple struct {
	Key   string `json:"k"`
	Value string `json:"v"`
}

type TupleInt

type TupleInt struct {
	Key   int `json:"k"`
	Value int `json:"v"`
}

type TupleStringInt

type TupleStringInt struct {
	Key   string `json:"k"`
	Value int64  `json:"v"`
}

Jump to

Keyboard shortcuts

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