constant

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRecentDuration = "24h"
	MaxRecentDuration     = "4320h"
)
View Source
const (
	// PenguinIDAuthMaxCookieAge in seconds
	PenguinIDAuthMaxCookieAgeSec = 313560000

	PenguinIDCookieKey = "userID"

	// PenguinIDSetHeader is for the header in which sets PenguinID
	PenguinIDSetHeader = "X-Penguin-Set-PenguinID"

	// PenguinIDAuthorizationRealm is the authorization realm (prefix of value
	// in the `Authorization` header)
	PenguinIDAuthorizationRealm = "PenguinID"

	LocalsAccountIDKey = "accountId"
)
View Source
const (
	ContextKeyRequestID = "requestid"

	IdempotencyHeader    = "X-Penguin-Idempotency"
	IdempotencyKeyHeader = "X-Penguin-Idempotency-Key"

	IdempotencyKeyLengthLimit = 128
	IdempotencyKeyLocalsKey   = "idempotencyKey"

	CacheHeader = "X-Penguin-Cache"
)
View Source
const (
	ItemTypeCardExp    = "CARD_EXP"
	ItemTypeMaterial   = "MATERIAL"
	ItemTypeChip       = "CHIP"
	ItemTypeFurniture  = "FURN"
	ItemTypeArkPlanner = "ARKPLANNER"
	ItemTypeActivity   = "ACTIVITY_ITEM"
	ItemTypeTemp       = "TEMP"
	ItemTypeLggShd     = "LGG_SHD"
)
View Source
const (
	MaxIntervalNum     = 360
	DefaultIntervalNum = 60

	StdDevDigits = 4

	SourceCategoryManual    = "manual"
	SourceCategoryAutomated = "automated"
	SourceCategoryAll       = "all"

	WorkerParallelism = 2
)
View Source
const (
	FurnitureArkItemID = "furni"

	ExtraProcessTypeGachaBox = "GACHABOX"

	ReportRedisPrefix = "report:"

	DropTypeRegular         = "REGULAR"
	DropTypeSpecial         = "SPECIAL"
	DropTypeExtra           = "EXTRA"
	DropTypeRecognitionOnly = "RECOGNITION_ONLY"
	DropTypeFurniture       = "FURNITURE"

	ViolationReliabilityUser                 = 1 << 2
	ViolationReliabilityMD5                  = 1<<2 + 1
	ViolationReliabilityDrop                 = 1<<2 + 2
	ViolationReliabilityRejectRuleUnexpected = 1<<2 + 3

	ViolationReliabilityRejectRuleRangeLeast = 1 << 8
	ViolationReliabilityRejectRuleRangeMost  = 1 << 10

	ReportIdempotencyLifetime     = time.Hour * 4
	ReportIdempotencyRedisHashKey = "report-idempotency"

	RecruitStageID  = "recruit"
	RecruitItemType = "RECRUIT_TAG"
)
View Source
const (
	FormulaPropertyKey = "formula"

	FrontendConfigPropertyKey = "frontend_config"

	// SlimHeaderKey is to indicate whether the current request shall be ignored by Sentry transaction tracing.
	// This is typically used by probes to avoid useless data being sent to Sentry.
	SlimHeaderKey = "X-Slim"
)
View Source
const (
	SiteDefaultHost = "penguin-stats.io"

	SiteGlobalMirrorHost        = "penguin-stats.io"
	SiteChinaMainlandMirrorHost = "penguin-stats.cn"

	ShimCompatibilityHeaderKey   = "X-Penguin-Compatible"
	ShimCompatibilityHeaderValue = "frontend-v2@v3.4.0"

	DefaultServer = "CN"
)
View Source
const (
	FrontendV2         = "frontend-v2"
	FrontendV1         = "penguin-stats.io"
	FrontendV1Internal = "penguin-stats.io(internal)"
	MeoAssistant       = "MeoAssistant"
)
View Source
const (
	DefaultNullSanity = 99

	RerunStageIdSuffix     = "_rep"
	PermanentStageIdSuffix = "_perm"
)
View Source
const (
	FakeEndTimeMilli int64 = 62141368179000

	CNServerStartTimeMilli int64 = 1556676000000
	USServerStartTimeMilli int64 = 1579190400000
	JPServerStartTimeMilli int64 = 1579140000000
	KRServerStartTimeMilli int64 = 1579140000000

	GameDayStartHour   int = 4
	GameDayStartMinute int = 0
	GameDayStartSecond int = 0
	GameDayStartNano   int = 0
)
View Source
const (
	ZoneBackgroundPath      = "/backgrounds/zones/"
	ZoneBackgroundExtension = ".jpg"
)
View Source
const (
	ZoneCategoryMainline          = "MAINLINE"
	ZoneCategoryActivity          = "ACTIVITY"
	ZoneCategoryWeekly            = "WEEKLY"
	ZoneCategoryGachabox          = "GACHABOX"
	ZoneCategoryActivityPermanent = "ACTIVITY_PERMANENT"
)
View Source
const (
	ZoneTypeAwakeningHour = "AWAKENING_HOUR"
	ZoneTypeVisionShatter = "VISION_SHATTER"
	ZoneTypeDyingSun      = "DYING_SUN"
	ZoneTypeInterlude     = "INTERLUDE"
	ZoneTypeSidestory     = "SIDESTORY"
)
View Source
const CacheSep = "|"
View Source
const LiveWebSocketSubprotocol = "v3.penguin-stats.live+proto"

Variables

View Source
var DropTypeMap = map[string]string{
	"REGULAR_DROP": "REGULAR",
	"NORMAL_DROP":  "REGULAR",
	"SPECIAL_DROP": "SPECIAL",
	"EXTRA_DROP":   "EXTRA",
	"FURNITURE":    "FURNITURE",
}

DropTypeMap maps an API drop type to a database drop type. The map must not be modified.

View Source
var DropTypeMapKeys = []string{
	"NORMAL_DROP",
	"SPECIAL_DROP",
	"EXTRA_DROP",
}
View Source
var DropTypeReversedMap = map[string]string{
	"REGULAR":   "NORMAL_DROP",
	"SPECIAL":   "SPECIAL_DROP",
	"EXTRA":     "EXTRA_DROP",
	"FURNITURE": "FURNITURE",
}
View Source
var Languages = []string{
	"zh",
	"en",
	"jp",
	"ko",
}
View Source
var LocMap = map[string]*time.Location{
	"CN": time.FixedZone("UTC+8", +8*60*60),
	"US": time.FixedZone("UTC-7", -7*60*60),
	"JP": time.FixedZone("UTC+9", +9*60*60),
	"KR": time.FixedZone("UTC+9", +9*60*60),
}
View Source
var ServerIDMapping = map[string]uint8{
	"CN": 0,
	"US": 1,
	"JP": 2,
	"KR": 3,
}

ServerIDMapping should align with protobuf enum Server

View Source
var ServerMap = map[string]struct{}{
	"CN": {},
	"US": {},
	"JP": {},
	"KR": {},
}
View Source
var ServerNameMapping = map[string]string{
	"CN": "国服",
	"US": "美服",
	"JP": "日服",
	"KR": "韩服",
}
View Source
var ServerStartTimeMapMillis = map[string]int64{
	"CN": CNServerStartTimeMilli,
	"US": USServerStartTimeMilli,
	"JP": JPServerStartTimeMilli,
	"KR": KRServerStartTimeMilli,
}
View Source
var Servers = []string{
	"CN",
	"US",
	"JP",
	"KR",
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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