gcp

package
v0.0.0-...-24140c1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinPredicates

func JoinPredicates(lhs string, operator string, rhs string) string

Capitalzied to supress no useage warning

Types

type Code

type Code struct {
	CODE string `bigquery:"CODE"`
}

type GlobalResult

type GlobalResult struct {
	Result int `bigquery:"RESULT"`
	Count  int `bigquery:"COUNT"`
}

type RatingDataPoint

type RatingDataPoint struct {
	Time   int     `bigQuery:"TIME"`
	Rating float32 `bigquery:"RATING"`
}

type SearchResultWrapper

type SearchResultWrapper struct {
	Name string `bigquery:"name"`
}

type Service

type Service struct {
	ProjectId         string
	SyncReplayTopicId string
	DataSet           string
	models.Telemetry
}

func InitGCPBackend

func InitGCPBackend(telemetry models.Telemetry) Service

func NewGcpProvider

func NewGcpProvider(projectId string, syncTopicId string, dataset string, telemetry models.Telemetry) Service

func (Service) GetCheckReplay

func (p Service) GetCheckReplay(ctx context.Context, codes []string) (models.CheckReplay, error)

func (Service) GetGlobalWinrate

func (p Service) GetGlobalWinrate(ctx context.Context) (models.WinRate, error)

func (Service) GetLeaderBoard

func (p Service) GetLeaderBoard(ctx context.Context, limit int) ([]models.PlayerInfo, error)

func (Service) GetPlayerActivity

func (p Service) GetPlayerActivity(ctx context.Context, name string, constrain models.RangeConstrain) (models.PlayerActivityCalendar, error)

func (Service) GetPlayerInfo

func (p Service) GetPlayerInfo(ctx context.Context, name string) (models.PlayerInfo, error)

func (Service) GetPlayerRating

func (p Service) GetPlayerRating(ctx context.Context, name string, constrain models.RangeConstrain, datapoints int) (models.PlayerRatingTimeSeries, error)

func (Service) GetPlayerRecord

func (p Service) GetPlayerRecord(ctx context.Context, name string) (models.PlayerRecord, error)

func (Service) GetPlayerTimeOfDayActivity

func (p Service) GetPlayerTimeOfDayActivity(ctx context.Context, name string) (models.TimeOfDayActivity, error)

func (Service) GetPlayerUnitWinRate

func (p Service) GetPlayerUnitWinRate(ctx context.Context, playerName string, constrain models.RangeConstrain, limit int) ([]models.KeyedGameRecord, error)

func (Service) GetRatingDistribution

func (p Service) GetRatingDistribution(ctx context.Context) (models.RatingDistributionWrapper, error)

func (Service) GetUnitsWinRate

func (p Service) GetUnitsWinRate(ctx context.Context, unitName string) ([]models.KeyedGameRecord, error)

func (Service) QueryReplays

func (p Service) QueryReplays(ctx context.Context, query models.ReplayQuery) ([]models.Replay, error)

func (Service) SearchPlayer

func (p Service) SearchPlayer(ctx context.Context, name string) ([]string, error)

SearchPlayer Could update this with better search algorithm https://mark-mccracken.medium.com/bigquery-fuzzy-matching-functions-c4f051cbe2bb

func (Service) SubmitReplays

func (p Service) SubmitReplays(ctx context.Context, codes []string) error

type TimeOfDayDataPoint

type TimeOfDayDataPoint struct {
	Hour int64 `json:"hour"`
	Freq int64 `json:"freq"`
}

Jump to

Keyboard shortcuts

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