Documentation ¶
Index ¶
- Variables
- func DownloadReplay(replay string, localFilePath string) error
- func InitCloudLogger() zerolog.Logger
- func InitStdLogger() zerolog.Logger
- func InitTrace(runtimeProvider string) (trace.Tracer, error)
- func Reverse(s string) string
- func SpanFromCtx(ctx context.Context, t Telemetry, spanName string) (context.Context, trace.Span)
- func UnmarshalSpanCtx(code Code) trace.SpanContext
- func ValidateCodes(ctx context.Context, raw string) []string
- type ActivityCalendarDay
- type BestUnit
- type CheckReplay
- type Code
- type Codes
- type DeckInfoV1
- type DeckInfoV2
- type Event
- type GCPWriter
- type GameRecord
- type HighestOpponent
- type KeyedGameRecord
- type MergedDeck
- type PlayerActivityCalendar
- type PlayerInfo
- type PlayerInfoV1
- type PlayerInfoV2
- type PlayerRatingTimeSeries
- type PlayerRecord
- type PlayerTime
- type PlayerUnitGameRecord
- type RangeConstrain
- type Rating
- type RatingDistribution
- type RatingDistributionWrapper
- type RatingInfo
- type RatingOpt
- type RatingSeries
- type RawReplayBase
- func (r RawReplayBase) GetCode() string
- func (r RawReplayBase) GetEndCondition() int64
- func (r RawReplayBase) GetEndTime() int64
- func (r RawReplayBase) GetFormat() int64
- func (r RawReplayBase) GetResult() int64
- func (r RawReplayBase) GetStartTime() int64
- func (r RawReplayBase) P1EloIni() float32
- func (r RawReplayBase) P1RatingChange() float32
- func (r RawReplayBase) P2EloIni() float32
- func (r RawReplayBase) P2RatingChange() float32
- func (r RawReplayBase) Version() int64
- type RawReplayV1
- type RawReplayV2
- type Replay
- type ReplayLike
- type ReplayQuery
- type SpanCtx
- type Telemetry
- type TimeInfoV1
- type TimeInfoV2
- type TimeOfDayActivity
- type VersionInfo
- type WinRate
- type WinStreak
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFoundError = errors.New("404")
View Source
var ErrNotImplemented = errors.New("not implemented")
Functions ¶
func DownloadReplay ¶
func InitCloudLogger ¶
func InitStdLogger ¶
func UnmarshalSpanCtx ¶
func UnmarshalSpanCtx(code Code) trace.SpanContext
Types ¶
type ActivityCalendarDay ¶
type CheckReplay ¶
type Code ¶
func UnmarshalCode ¶
type DeckInfoV1 ¶
type DeckInfoV1 struct {
MergedDeck []MergedDeck `json:"mergedDeck"`
}
type DeckInfoV2 ¶
type DeckInfoV2 struct {
Randomizer [][]string `json:"randomizer"`
}
type GameRecord ¶
type GameRecord struct { P1Win int `bigquery:"p1w" json:"p1w"` P2Win int `bigquery:"p2w" json:"p2w"` P1Draw int `bigquery:"p1d" json:"p1d"` P2Draw int `bigquery:"p2d" json:"p2d"` P1Loss int `bigquery:"p1l" json:"p1l"` P2Loss int `bigquery:"p2l" json:"p2l"` }
func (GameRecord) Draws ¶
func (g GameRecord) Draws() int
func (GameRecord) Losses ¶
func (g GameRecord) Losses() int
func (GameRecord) TotalGames ¶
func (g GameRecord) TotalGames() int
func (GameRecord) WinRate ¶
func (g GameRecord) WinRate() float32
func (GameRecord) Wins ¶
func (g GameRecord) Wins() int
type HighestOpponent ¶
type KeyedGameRecord ¶
type KeyedGameRecord struct { Name string `bigquery:"name" json:"name"` GameRecord }
type MergedDeck ¶
type PlayerActivityCalendar ¶
type PlayerActivityCalendar struct {
Calendar []ActivityCalendarDay `json:"calendar"`
}
type PlayerInfo ¶
type PlayerInfo struct { Name string `json:"name" bigquery:"pname"` LastGameTimeStamp int `json:"lastGameTimeStamp" bigquery:"LAST_GAME_TIME"` Rating float32 `json:"rating" bigquery:"rating"` MaxRating float32 `json:"maxRating" bigquery:"MAX_RATING"` GameRecord }
type PlayerInfoV1 ¶
type PlayerInfoV2 ¶
type PlayerRatingTimeSeries ¶
type PlayerRatingTimeSeries struct { TierRatingData RatingSeries `json:"tierRatingData"` EloRatingData RatingSeries `json:"eloRatingData"` }
type PlayerRecord ¶
type PlayerRecord struct { MaxRating int `json:"maxRating"` BestUnit BestUnit `json:"bestUnit"` HighestOpponent HighestOpponent `json:"highestOpponent"` WinStreak WinStreak `json:"winStreak"` GameRecord GameRecord `json:"gameRecord"` }
type PlayerTime ¶
type PlayerTime struct {
Initial float32 `json:"initial"`
}
type PlayerUnitGameRecord ¶
type PlayerUnitGameRecord struct { PlayerName string `bigquery:"pname"` Unit string `bigquery:"UNIT"` GameRecord }
type RangeConstrain ¶
RangeConstrain Unix time in seconds
func UnboundTimeConstrain ¶
func UnboundTimeConstrain() RangeConstrain
type RatingDistribution ¶
type RatingDistributionWrapper ¶
type RatingDistributionWrapper struct { Tier RatingDistribution `json:"tier"` Elo RatingDistribution `json:"elo"` }
type RatingInfo ¶
type RatingSeries ¶
type RawReplayBase ¶
type RawReplayBase struct { Code string `json:"code"` Format int64 `json:"format"` StartTime float64 `json:"startTime"` EndTime float64 `json:"endTime"` VersionInfo VersionInfo `json:"versionInfo"` Result int64 `json:"result"` EndCondition int64 `json:"endCondition"` RatingInfo RatingInfo `json:"ratingInfo"` }
func (RawReplayBase) GetCode ¶
func (r RawReplayBase) GetCode() string
func (RawReplayBase) GetEndCondition ¶
func (r RawReplayBase) GetEndCondition() int64
func (RawReplayBase) GetEndTime ¶
func (r RawReplayBase) GetEndTime() int64
func (RawReplayBase) GetFormat ¶
func (r RawReplayBase) GetFormat() int64
func (RawReplayBase) GetResult ¶
func (r RawReplayBase) GetResult() int64
func (RawReplayBase) GetStartTime ¶
func (r RawReplayBase) GetStartTime() int64
func (RawReplayBase) P1EloIni ¶
func (r RawReplayBase) P1EloIni() float32
func (RawReplayBase) P1RatingChange ¶
func (r RawReplayBase) P1RatingChange() float32
func (RawReplayBase) P2EloIni ¶
func (r RawReplayBase) P2EloIni() float32
func (RawReplayBase) P2RatingChange ¶
func (r RawReplayBase) P2RatingChange() float32
func (RawReplayBase) Version ¶
func (r RawReplayBase) Version() int64
type RawReplayV1 ¶
type RawReplayV1 struct { RawReplayBase TimeInfo TimeInfoV1 `json:"timeInfo"` DeckInfo DeckInfoV1 `json:"deckInfo"` PlayerInfo PlayerInfoV1 `json:"playerInfo"` }
func (RawReplayV1) Deck ¶
func (r RawReplayV1) Deck() []string
func (RawReplayV1) P1Name ¶
func (r RawReplayV1) P1Name() string
func (RawReplayV1) P2Name ¶
func (r RawReplayV1) P2Name() string
func (RawReplayV1) TimeControl ¶
func (r RawReplayV1) TimeControl() int64
type RawReplayV2 ¶
type RawReplayV2 struct { RawReplayBase TimeInfo TimeInfoV2 `json:"timeInfo"` DeckInfo DeckInfoV2 `json:"deckInfo"` PlayerInfo []PlayerInfoV2 `json:"playerInfo"` }
func (RawReplayV2) Deck ¶
func (r RawReplayV2) Deck() []string
func (RawReplayV2) P1Name ¶
func (r RawReplayV2) P1Name() string
func (RawReplayV2) P2Name ¶
func (r RawReplayV2) P2Name() string
func (RawReplayV2) TimeControl ¶
func (r RawReplayV2) TimeControl() int64
type Replay ¶
type Replay struct { Code string `bigquery:"CODE"` Format int64 `bigquery:"FORMAT"` Deck []string `bigquery:"DECK"` EndCondition int64 `bigquery:"END_CONDITION"` Result int64 `bigquery:"RESULT"` // 0: player1Win, 1:player2Win, 2:Draw TimeCondition int64 `bigquery:"TIME_CONDITION"` StartTime int64 `bigquery:"START_TIME"` EndTime int64 `bigquery:"END_TIME"` Version int64 `bigquery:"VERSION"` P1Name string `bigquery:"P1_NAME"` P1RatingIni float64 `bigquery:"P1_RATING_INI"` P1RatingChange float64 `bigquery:"P1_RATING_CHANGE"` P2Name string `bigquery:"P2_NAME"` P2RatingIni float64 `bigquery:"P2_RATING_INI"` P2RatingChange float64 `bigquery:"P2_RATING_CHANGE"` }
func FromReplayLike ¶
func FromReplayLike(r ReplayLike) Replay
type ReplayLike ¶
type ReplayLike interface { GetCode() string GetFormat() int64 GetStartTime() int64 GetEndTime() int64 Version() int64 Deck() []string TimeControl() int64 GetResult() int64 // 0 p1w, 1 p2w, 2 draw GetEndCondition() int64 P1Name() string P1EloIni() float32 P1RatingChange() float32 P2Name() string P2EloIni() float32 P2RatingChange() float32 }
func UnmarshalReplay ¶
func UnmarshalReplay(data []byte) (ReplayLike, error)
type ReplayQuery ¶
type ReplayQuery struct { Players map[string]bool Units []string TimeConstrain RangeConstrain RatingConstrain RangeConstrain ReplayStrict bool ReplayType string Limit int }
type SpanCtx ¶
func MarshalSpanCtx ¶
type TimeInfoV1 ¶
type TimeInfoV1 struct {
PlayerInitialTimeBanks []int64 `json:"playerInitialTimeBanks"`
}
type TimeInfoV2 ¶
type TimeInfoV2 struct {
PlayerTime []PlayerTime `json:"playerTime"`
}
type TimeOfDayActivity ¶
type VersionInfo ¶
type VersionInfo struct {
ServerVersion int64 `json:"serverVersion"`
}
Click to show internal directories.
Click to hide internal directories.