Documentation ¶
Index ¶
- Variables
- type App
- func (app *App) AddError()
- func (app *App) BulkUpsertScores(ctx context.Context, req *api.BulkUpsertScoresRequest) (*api.BulkUpsertScoresResponse, error)
- func (app *App) GetAroundMember(ctx context.Context, req *api.GetAroundMemberRequest) (*api.GetAroundMemberResponse, error)
- func (app *App) GetAroundScore(ctx context.Context, req *api.GetAroundScoreRequest) (*api.GetAroundScoreResponse, error)
- func (app *App) GetMember(ctx context.Context, req *api.GetMemberRequest) (*api.GetMemberResponse, error)
- func (app *App) GetMembers(ctx context.Context, req *api.GetMembersRequest) (*api.GetMembersResponse, error)
- func (app *App) GetRank(ctx context.Context, req *api.GetRankRequest) (*api.GetRankResponse, error)
- func (app *App) GetRankMultiLeaderboards(ctx context.Context, req *api.GetRankMultiLeaderboardsRequest) (*api.GetRankMultiLeaderboardsResponse, error)
- func (app *App) GetTopMembers(ctx context.Context, req *api.GetTopMembersRequest) (*api.GetTopMembersResponse, error)
- func (app *App) GetTopPercentage(ctx context.Context, req *api.GetTopPercentageRequest) (*api.GetTopPercentageResponse, error)
- func (app *App) GracefullStop()
- func (app *App) HealthCheck(ctx context.Context, req *api.HealthCheckRequest) (*api.HealthCheckResponse, error)
- func (app *App) IncrementScore(ctx context.Context, req *api.IncrementScoreRequest) (*api.IncrementScoreResponse, error)
- func (app *App) OnErrorHandler(err error, stack []byte)
- func (app *App) RemoveLeaderboard(ctx context.Context, req *api.RemoveLeaderboardRequest) (*api.RemoveLeaderboardResponse, error)
- func (app *App) RemoveMember(ctx context.Context, req *api.RemoveMemberRequest) (*api.RemoveMemberResponse, error)
- func (app *App) RemoveMembers(ctx context.Context, req *api.RemoveMembersRequest) (*api.RemoveMembersResponse, error)
- func (app *App) Start(ctx context.Context) error
- func (app *App) Status(ctx context.Context, req *empty.Empty) (*api.StatusResponse, error)
- func (app *App) TotalMembers(ctx context.Context, req *api.TotalMembersRequest) (*api.TotalMembersResponse, error)
- func (app *App) UpsertScore(ctx context.Context, req *api.UpsertScoreRequest) (*api.UpsertScoreResponse, error)
- func (app *App) UpsertScoreMultiLeaderboards(ctx context.Context, req *api.UpsertScoreMultiLeaderboardsRequest) (*api.UpsertScoreMultiLeaderboardsResponse, error)
- func (app *App) WaitForReady(d time.Duration) error
- type EasyJSONMarshaler
- type EasyJSONUnmarshaler
- type JSON
Constants ¶
This section is empty.
Variables ¶
var VERSION = "8.0.0"
VERSION identifies podium's current version
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { Debug bool // HTTP endpoint for HTTP requests. Built after calling Start. Format: 127.0.0.1:8080 HTTPEndpoint string // GRPC endpoint for GRPC requests. Built after calling Start. Format: 127.0.0.1:8081 GRPCEndpoint string ConfigPath string Errors metrics.EWMA Config *viper.Viper Logger zap.Logger Leaderboards *leaderboard.Client NewRelic newrelic.Application DDStatsD *extnethttpmiddleware.DogStatsD // contains filtered or unexported fields }
App is a struct that represents a podium Application
func New ¶
func New(host string, httpPort, grpcPort int, configPath string, debug bool, logger zap.Logger) (*App, error)
New returns a new podium Application. If httpPort is sent as zero, a random port will be selected (the same will happen for grpcPort)
func (*App) BulkUpsertScores ¶
func (app *App) BulkUpsertScores(ctx context.Context, req *api.BulkUpsertScoresRequest) (*api.BulkUpsertScoresResponse, error)
BulkUpsertScores is the handler responsible for creating or updating members score.
func (*App) GetAroundMember ¶
func (app *App) GetAroundMember(ctx context.Context, req *api.GetAroundMemberRequest) (*api.GetAroundMemberResponse, error)
GetAroundMember retrieves a list of member score and rank centered req the given member.
func (*App) GetAroundScore ¶
func (app *App) GetAroundScore(ctx context.Context, req *api.GetAroundScoreRequest) (*api.GetAroundScoreResponse, error)
GetAroundScore retrieves a list of member scores and ranks centered req a given score.
func (*App) GetMember ¶
func (app *App) GetMember(ctx context.Context, req *api.GetMemberRequest) (*api.GetMemberResponse, error)
GetMember is the handler responsible for retrieving a member score and rank.
func (*App) GetMembers ¶
func (app *App) GetMembers(ctx context.Context, req *api.GetMembersRequest) (*api.GetMembersResponse, error)
GetMembers retrieves several members at once.
func (*App) GetRank ¶
func (app *App) GetRank(ctx context.Context, req *api.GetRankRequest) (*api.GetRankResponse, error)
GetRank is the handler responsible for retrieving a member rank.
func (*App) GetRankMultiLeaderboards ¶
func (app *App) GetRankMultiLeaderboards(ctx context.Context, req *api.GetRankMultiLeaderboardsRequest) (*api.GetRankMultiLeaderboardsResponse, error)
GetRankMultiLeaderboards returns the member rank req several leaderboards at once.
func (*App) GetTopMembers ¶
func (app *App) GetTopMembers(ctx context.Context, req *api.GetTopMembersRequest) (*api.GetTopMembersResponse, error)
GetTopMembers retrieves onePage of member score and rank.
func (*App) GetTopPercentage ¶
func (app *App) GetTopPercentage(ctx context.Context, req *api.GetTopPercentageRequest) (*api.GetTopPercentageResponse, error)
GetTopPercentage retrieves top x % members req the leaderboard.
func (*App) GracefullStop ¶
func (app *App) GracefullStop()
GracefulStop attempts to stop the server.
func (*App) HealthCheck ¶
func (app *App) HealthCheck(ctx context.Context, req *api.HealthCheckRequest) (*api.HealthCheckResponse, error)
func (*App) IncrementScore ¶
func (app *App) IncrementScore(ctx context.Context, req *api.IncrementScoreRequest) (*api.IncrementScoreResponse, error)
IncrementScore is the handler responsible for incrementing the member score.
func (*App) OnErrorHandler ¶
OnErrorHandler handles panics
func (*App) RemoveLeaderboard ¶
func (app *App) RemoveLeaderboard(ctx context.Context, req *api.RemoveLeaderboardRequest) (*api.RemoveLeaderboardResponse, error)
RemoveLeaderboard is the handler responsible for removing a leaderboard.
func (*App) RemoveMember ¶
func (app *App) RemoveMember(ctx context.Context, req *api.RemoveMemberRequest) (*api.RemoveMemberResponse, error)
TODO: Make this function use RemoveMembers RemoveMember removes a member from a leaderboard.
func (*App) RemoveMembers ¶
func (app *App) RemoveMembers(ctx context.Context, req *api.RemoveMembersRequest) (*api.RemoveMembersResponse, error)
RemoveMembers removes several members from a leaderboard.
func (*App) TotalMembers ¶
func (app *App) TotalMembers(ctx context.Context, req *api.TotalMembersRequest) (*api.TotalMembersResponse, error)
TotalMembers is the handler responsible for returning the total number of members req a leaderboard.
func (*App) UpsertScore ¶
func (app *App) UpsertScore(ctx context.Context, req *api.UpsertScoreRequest) (*api.UpsertScoreResponse, error)
UpsertScore is the handler responsible for creating or updating the member score.
func (*App) UpsertScoreMultiLeaderboards ¶
func (app *App) UpsertScoreMultiLeaderboards(ctx context.Context, req *api.UpsertScoreMultiLeaderboardsRequest) (*api.UpsertScoreMultiLeaderboardsResponse, error)
UpsertScoreMultiLeaderboards sets the member score for all leaderboards.
type EasyJSONMarshaler ¶
EasyJSONMarshaler describes a struct able to marshal json
type EasyJSONUnmarshaler ¶
EasyJSONUnmarshaler describes a struct able to unmarshal json