Documentation ¶
Overview ¶
Package leaderboard is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterLeaderboardPrivateServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterLeaderboardPrivateServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, ...) error
- func RegisterLeaderboardPrivateServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterLeaderboardPrivateServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, ...) error
- func RegisterLeaderboardPrivateServiceServer(s grpc.ServiceRegistrar, srv LeaderboardPrivateServiceServer)
- func RegisterLeaderboardServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterLeaderboardServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LeaderboardServiceClient) error
- func RegisterLeaderboardServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterLeaderboardServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LeaderboardServiceServer) error
- func RegisterLeaderboardServiceServer(s grpc.ServiceRegistrar, srv LeaderboardServiceServer)
- type ClearLeaderboardRequest
- func (*ClearLeaderboardRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ClearLeaderboardRequest) GetId() string
- func (*ClearLeaderboardRequest) ProtoMessage()
- func (x *ClearLeaderboardRequest) ProtoReflect() protoreflect.Message
- func (x *ClearLeaderboardRequest) Reset()
- func (x *ClearLeaderboardRequest) String() string
- type ClearLeaderboardResponse
- type ExpireLeaderboardRequest
- func (*ExpireLeaderboardRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ExpireLeaderboardRequest) GetExpireTime() int64
- func (x *ExpireLeaderboardRequest) GetId() string
- func (x *ExpireLeaderboardRequest) GetNum() int32
- func (*ExpireLeaderboardRequest) ProtoMessage()
- func (x *ExpireLeaderboardRequest) ProtoReflect() protoreflect.Message
- func (x *ExpireLeaderboardRequest) Reset()
- func (x *ExpireLeaderboardRequest) String() string
- type ExpireLeaderboardResponse
- func (*ExpireLeaderboardResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ExpireLeaderboardResponse) GetEntries() []*LeaderboardEntry
- func (x *ExpireLeaderboardResponse) GetIsDeleted() bool
- func (*ExpireLeaderboardResponse) ProtoMessage()
- func (x *ExpireLeaderboardResponse) ProtoReflect() protoreflect.Message
- func (x *ExpireLeaderboardResponse) Reset()
- func (x *ExpireLeaderboardResponse) String() string
- type GetLeaderboardRequest
- func (*GetLeaderboardRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetLeaderboardRequest) GetId() string
- func (x *GetLeaderboardRequest) GetPage() int32
- func (x *GetLeaderboardRequest) GetPageSize() int32
- func (*GetLeaderboardRequest) ProtoMessage()
- func (x *GetLeaderboardRequest) ProtoReflect() protoreflect.Message
- func (x *GetLeaderboardRequest) Reset()
- func (x *GetLeaderboardRequest) String() string
- type GetLeaderboardResponse
- func (*GetLeaderboardResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetLeaderboardResponse) GetEntries() []*LeaderboardEntry
- func (x *GetLeaderboardResponse) GetIsDeleted() bool
- func (*GetLeaderboardResponse) ProtoMessage()
- func (x *GetLeaderboardResponse) ProtoReflect() protoreflect.Message
- func (x *GetLeaderboardResponse) Reset()
- func (x *GetLeaderboardResponse) String() string
- type GetRankRequest
- func (*GetRankRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetRankRequest) GetCountry() string
- func (x *GetRankRequest) GetId() string
- func (*GetRankRequest) ProtoMessage()
- func (x *GetRankRequest) ProtoReflect() protoreflect.Message
- func (x *GetRankRequest) Reset()
- func (x *GetRankRequest) String() string
- type GetRankResponse
- func (*GetRankResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetRankResponse) GetRank() int64
- func (x *GetRankResponse) GetScore() float64
- func (*GetRankResponse) ProtoMessage()
- func (x *GetRankResponse) ProtoReflect() protoreflect.Message
- func (x *GetRankResponse) Reset()
- func (x *GetRankResponse) String() string
- type LeaderboardEntry
- func (*LeaderboardEntry) Descriptor() ([]byte, []int)deprecated
- func (x *LeaderboardEntry) GetScore() float64
- func (x *LeaderboardEntry) GetStar() int64
- func (x *LeaderboardEntry) GetUid() string
- func (*LeaderboardEntry) ProtoMessage()
- func (x *LeaderboardEntry) ProtoReflect() protoreflect.Message
- func (x *LeaderboardEntry) Reset()
- func (x *LeaderboardEntry) String() string
- type LeaderboardPrivateServiceClient
- type LeaderboardPrivateServiceServer
- type LeaderboardServiceClient
- type LeaderboardServiceServer
- type StarLeaderboardRequest
- func (*StarLeaderboardRequest) Descriptor() ([]byte, []int)deprecated
- func (x *StarLeaderboardRequest) GetId() string
- func (x *StarLeaderboardRequest) GetUid() string
- func (*StarLeaderboardRequest) ProtoMessage()
- func (x *StarLeaderboardRequest) ProtoReflect() protoreflect.Message
- func (x *StarLeaderboardRequest) Reset()
- func (x *StarLeaderboardRequest) String() string
- type StarLeaderboardResponse
- func (*StarLeaderboardResponse) Descriptor() ([]byte, []int)deprecated
- func (x *StarLeaderboardResponse) GetStarCount() int64
- func (*StarLeaderboardResponse) ProtoMessage()
- func (x *StarLeaderboardResponse) ProtoReflect() protoreflect.Message
- func (x *StarLeaderboardResponse) Reset()
- func (x *StarLeaderboardResponse) String() string
- type UnimplementedLeaderboardPrivateServiceServer
- func (UnimplementedLeaderboardPrivateServiceServer) ClearLeaderboard(context.Context, *ClearLeaderboardRequest) (*ClearLeaderboardResponse, error)
- func (UnimplementedLeaderboardPrivateServiceServer) ExpireLeaderboard(context.Context, *ExpireLeaderboardRequest) (*ExpireLeaderboardResponse, error)
- func (UnimplementedLeaderboardPrivateServiceServer) UpdateScore(context.Context, *UpdateScoreRequest) (*UpdateScoreResponse, error)
- type UnimplementedLeaderboardServiceServer
- func (UnimplementedLeaderboardServiceServer) GetLeaderboard(context.Context, *GetLeaderboardRequest) (*GetLeaderboardResponse, error)
- func (UnimplementedLeaderboardServiceServer) GetRank(context.Context, *GetRankRequest) (*GetRankResponse, error)
- func (UnimplementedLeaderboardServiceServer) StarLeaderboard(context.Context, *StarLeaderboardRequest) (*StarLeaderboardResponse, error)
- type UnsafeLeaderboardPrivateServiceServer
- type UnsafeLeaderboardServiceServer
- type UpdateScoreRequest
- func (*UpdateScoreRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateScoreRequest) GetId() string
- func (x *UpdateScoreRequest) GetScores() map[string]float64
- func (x *UpdateScoreRequest) GetUpdateType() UpdateScoreRequest_UpdateType
- func (*UpdateScoreRequest) ProtoMessage()
- func (x *UpdateScoreRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateScoreRequest) Reset()
- func (x *UpdateScoreRequest) String() string
- type UpdateScoreRequest_UpdateType
- func (UpdateScoreRequest_UpdateType) Descriptor() protoreflect.EnumDescriptor
- func (x UpdateScoreRequest_UpdateType) Enum() *UpdateScoreRequest_UpdateType
- func (UpdateScoreRequest_UpdateType) EnumDescriptor() ([]byte, []int)deprecated
- func (x UpdateScoreRequest_UpdateType) Number() protoreflect.EnumNumber
- func (x UpdateScoreRequest_UpdateType) String() string
- func (UpdateScoreRequest_UpdateType) Type() protoreflect.EnumType
- type UpdateScoreResponse
- func (*UpdateScoreResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateScoreResponse) GetCurrentUid() string
- func (x *UpdateScoreResponse) GetId() string
- func (x *UpdateScoreResponse) GetOldUid() string
- func (*UpdateScoreResponse) ProtoMessage()
- func (x *UpdateScoreResponse) ProtoReflect() protoreflect.Message
- func (x *UpdateScoreResponse) Reset()
- func (x *UpdateScoreResponse) String() string
Constants ¶
const ( LeaderboardService_GetLeaderboard_FullMethodName = "/leaderboard.pb.LeaderboardService/GetLeaderboard" LeaderboardService_GetRank_FullMethodName = "/leaderboard.pb.LeaderboardService/GetRank" LeaderboardService_StarLeaderboard_FullMethodName = "/leaderboard.pb.LeaderboardService/StarLeaderboard" )
const ( LeaderboardPrivateService_ExpireLeaderboard_FullMethodName = "/leaderboard.pb.LeaderboardPrivateService/ExpireLeaderboard" LeaderboardPrivateService_UpdateScore_FullMethodName = "/leaderboard.pb.LeaderboardPrivateService/UpdateScore" LeaderboardPrivateService_ClearLeaderboard_FullMethodName = "/leaderboard.pb.LeaderboardPrivateService/ClearLeaderboard" )
Variables ¶
var ( UpdateScoreRequest_UpdateType_name = map[int32]string{ 0: "ADD", 1: "GTR", 2: "LSR", } UpdateScoreRequest_UpdateType_value = map[string]int32{ "ADD": 0, "GTR": 1, "LSR": 2, } )
Enum value maps for UpdateScoreRequest_UpdateType.
var File_leaderboard_leaderboard_proto protoreflect.FileDescriptor
var LeaderboardPrivateService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "leaderboard.pb.LeaderboardPrivateService", HandlerType: (*LeaderboardPrivateServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ExpireLeaderboard", Handler: _LeaderboardPrivateService_ExpireLeaderboard_Handler, }, { MethodName: "UpdateScore", Handler: _LeaderboardPrivateService_UpdateScore_Handler, }, { MethodName: "ClearLeaderboard", Handler: _LeaderboardPrivateService_ClearLeaderboard_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "leaderboard/leaderboard.proto", }
LeaderboardPrivateService_ServiceDesc is the grpc.ServiceDesc for LeaderboardPrivateService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var LeaderboardService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "leaderboard.pb.LeaderboardService", HandlerType: (*LeaderboardServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetLeaderboard", Handler: _LeaderboardService_GetLeaderboard_Handler, }, { MethodName: "GetRank", Handler: _LeaderboardService_GetRank_Handler, }, { MethodName: "StarLeaderboard", Handler: _LeaderboardService_StarLeaderboard_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "leaderboard/leaderboard.proto", }
LeaderboardService_ServiceDesc is the grpc.ServiceDesc for LeaderboardService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterLeaderboardPrivateServiceHandler ¶
func RegisterLeaderboardPrivateServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterLeaderboardPrivateServiceHandler registers the http handlers for service LeaderboardPrivateService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterLeaderboardPrivateServiceHandlerClient ¶
func RegisterLeaderboardPrivateServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LeaderboardPrivateServiceClient) error
RegisterLeaderboardPrivateServiceHandlerClient registers the http handlers for service LeaderboardPrivateService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "LeaderboardPrivateServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "LeaderboardPrivateServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "LeaderboardPrivateServiceClient" to call the correct interceptors.
func RegisterLeaderboardPrivateServiceHandlerFromEndpoint ¶
func RegisterLeaderboardPrivateServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterLeaderboardPrivateServiceHandlerFromEndpoint is same as RegisterLeaderboardPrivateServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterLeaderboardPrivateServiceHandlerServer ¶
func RegisterLeaderboardPrivateServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LeaderboardPrivateServiceServer) error
RegisterLeaderboardPrivateServiceHandlerServer registers the http handlers for service LeaderboardPrivateService to "mux". UnaryRPC :call LeaderboardPrivateServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterLeaderboardPrivateServiceHandlerFromEndpoint instead.
func RegisterLeaderboardPrivateServiceServer ¶
func RegisterLeaderboardPrivateServiceServer(s grpc.ServiceRegistrar, srv LeaderboardPrivateServiceServer)
func RegisterLeaderboardServiceHandler ¶
func RegisterLeaderboardServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterLeaderboardServiceHandler registers the http handlers for service LeaderboardService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterLeaderboardServiceHandlerClient ¶
func RegisterLeaderboardServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LeaderboardServiceClient) error
RegisterLeaderboardServiceHandlerClient registers the http handlers for service LeaderboardService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "LeaderboardServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "LeaderboardServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "LeaderboardServiceClient" to call the correct interceptors.
func RegisterLeaderboardServiceHandlerFromEndpoint ¶
func RegisterLeaderboardServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterLeaderboardServiceHandlerFromEndpoint is same as RegisterLeaderboardServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterLeaderboardServiceHandlerServer ¶
func RegisterLeaderboardServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LeaderboardServiceServer) error
RegisterLeaderboardServiceHandlerServer registers the http handlers for service LeaderboardService to "mux". UnaryRPC :call LeaderboardServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterLeaderboardServiceHandlerFromEndpoint instead.
func RegisterLeaderboardServiceServer ¶
func RegisterLeaderboardServiceServer(s grpc.ServiceRegistrar, srv LeaderboardServiceServer)
Types ¶
type ClearLeaderboardRequest ¶
type ClearLeaderboardRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // leaderboard id // contains filtered or unexported fields }
func (*ClearLeaderboardRequest) Descriptor
deprecated
func (*ClearLeaderboardRequest) Descriptor() ([]byte, []int)
Deprecated: Use ClearLeaderboardRequest.ProtoReflect.Descriptor instead.
func (*ClearLeaderboardRequest) GetId ¶
func (x *ClearLeaderboardRequest) GetId() string
func (*ClearLeaderboardRequest) ProtoMessage ¶
func (*ClearLeaderboardRequest) ProtoMessage()
func (*ClearLeaderboardRequest) ProtoReflect ¶
func (x *ClearLeaderboardRequest) ProtoReflect() protoreflect.Message
func (*ClearLeaderboardRequest) Reset ¶
func (x *ClearLeaderboardRequest) Reset()
func (*ClearLeaderboardRequest) String ¶
func (x *ClearLeaderboardRequest) String() string
type ClearLeaderboardResponse ¶
type ClearLeaderboardResponse struct {
// contains filtered or unexported fields
}
func (*ClearLeaderboardResponse) Descriptor
deprecated
func (*ClearLeaderboardResponse) Descriptor() ([]byte, []int)
Deprecated: Use ClearLeaderboardResponse.ProtoReflect.Descriptor instead.
func (*ClearLeaderboardResponse) ProtoMessage ¶
func (*ClearLeaderboardResponse) ProtoMessage()
func (*ClearLeaderboardResponse) ProtoReflect ¶
func (x *ClearLeaderboardResponse) ProtoReflect() protoreflect.Message
func (*ClearLeaderboardResponse) Reset ¶
func (x *ClearLeaderboardResponse) Reset()
func (*ClearLeaderboardResponse) String ¶
func (x *ClearLeaderboardResponse) String() string
type ExpireLeaderboardRequest ¶
type ExpireLeaderboardRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // leaderboard id ExpireTime int64 `protobuf:"varint,2,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"` // expire time in day(default:30d) Num int32 `protobuf:"varint,3,opt,name=num,proto3" json:"num,omitempty"` // number of entries need return // contains filtered or unexported fields }
func (*ExpireLeaderboardRequest) Descriptor
deprecated
func (*ExpireLeaderboardRequest) Descriptor() ([]byte, []int)
Deprecated: Use ExpireLeaderboardRequest.ProtoReflect.Descriptor instead.
func (*ExpireLeaderboardRequest) GetExpireTime ¶
func (x *ExpireLeaderboardRequest) GetExpireTime() int64
func (*ExpireLeaderboardRequest) GetId ¶
func (x *ExpireLeaderboardRequest) GetId() string
func (*ExpireLeaderboardRequest) GetNum ¶
func (x *ExpireLeaderboardRequest) GetNum() int32
func (*ExpireLeaderboardRequest) ProtoMessage ¶
func (*ExpireLeaderboardRequest) ProtoMessage()
func (*ExpireLeaderboardRequest) ProtoReflect ¶
func (x *ExpireLeaderboardRequest) ProtoReflect() protoreflect.Message
func (*ExpireLeaderboardRequest) Reset ¶
func (x *ExpireLeaderboardRequest) Reset()
func (*ExpireLeaderboardRequest) String ¶
func (x *ExpireLeaderboardRequest) String() string
type ExpireLeaderboardResponse ¶
type ExpireLeaderboardResponse struct { // is expired, if leaderboard already expired, return false, otherwise return true IsDeleted bool `protobuf:"varint,1,opt,name=is_deleted,json=isDeleted,proto3" json:"is_deleted,omitempty"` // leaderboard entries Entries []*LeaderboardEntry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"` // contains filtered or unexported fields }
func (*ExpireLeaderboardResponse) Descriptor
deprecated
func (*ExpireLeaderboardResponse) Descriptor() ([]byte, []int)
Deprecated: Use ExpireLeaderboardResponse.ProtoReflect.Descriptor instead.
func (*ExpireLeaderboardResponse) GetEntries ¶
func (x *ExpireLeaderboardResponse) GetEntries() []*LeaderboardEntry
func (*ExpireLeaderboardResponse) GetIsDeleted ¶
func (x *ExpireLeaderboardResponse) GetIsDeleted() bool
func (*ExpireLeaderboardResponse) ProtoMessage ¶
func (*ExpireLeaderboardResponse) ProtoMessage()
func (*ExpireLeaderboardResponse) ProtoReflect ¶
func (x *ExpireLeaderboardResponse) ProtoReflect() protoreflect.Message
func (*ExpireLeaderboardResponse) Reset ¶
func (x *ExpireLeaderboardResponse) Reset()
func (*ExpireLeaderboardResponse) String ¶
func (x *ExpireLeaderboardResponse) String() string
type GetLeaderboardRequest ¶
type GetLeaderboardRequest struct { // leaderboard id, required Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // page number, default 1 Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` // page size, default 10 PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // contains filtered or unexported fields }
func (*GetLeaderboardRequest) Descriptor
deprecated
func (*GetLeaderboardRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetLeaderboardRequest.ProtoReflect.Descriptor instead.
func (*GetLeaderboardRequest) GetId ¶
func (x *GetLeaderboardRequest) GetId() string
func (*GetLeaderboardRequest) GetPage ¶
func (x *GetLeaderboardRequest) GetPage() int32
func (*GetLeaderboardRequest) GetPageSize ¶
func (x *GetLeaderboardRequest) GetPageSize() int32
func (*GetLeaderboardRequest) ProtoMessage ¶
func (*GetLeaderboardRequest) ProtoMessage()
func (*GetLeaderboardRequest) ProtoReflect ¶
func (x *GetLeaderboardRequest) ProtoReflect() protoreflect.Message
func (*GetLeaderboardRequest) Reset ¶
func (x *GetLeaderboardRequest) Reset()
func (*GetLeaderboardRequest) String ¶
func (x *GetLeaderboardRequest) String() string
type GetLeaderboardResponse ¶
type GetLeaderboardResponse struct { Entries []*LeaderboardEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` IsDeleted bool `protobuf:"varint,2,opt,name=is_deleted,json=isDeleted,proto3" json:"is_deleted,omitempty"` // contains filtered or unexported fields }
func (*GetLeaderboardResponse) Descriptor
deprecated
func (*GetLeaderboardResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetLeaderboardResponse.ProtoReflect.Descriptor instead.
func (*GetLeaderboardResponse) GetEntries ¶
func (x *GetLeaderboardResponse) GetEntries() []*LeaderboardEntry
func (*GetLeaderboardResponse) GetIsDeleted ¶
func (x *GetLeaderboardResponse) GetIsDeleted() bool
func (*GetLeaderboardResponse) ProtoMessage ¶
func (*GetLeaderboardResponse) ProtoMessage()
func (*GetLeaderboardResponse) ProtoReflect ¶
func (x *GetLeaderboardResponse) ProtoReflect() protoreflect.Message
func (*GetLeaderboardResponse) Reset ¶
func (x *GetLeaderboardResponse) Reset()
func (*GetLeaderboardResponse) String ¶
func (x *GetLeaderboardResponse) String() string
type GetRankRequest ¶
type GetRankRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // leaderboard id Country string `protobuf:"bytes,2,opt,name=country,proto3" json:"country,omitempty"` // country code // contains filtered or unexported fields }
func (*GetRankRequest) Descriptor
deprecated
func (*GetRankRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRankRequest.ProtoReflect.Descriptor instead.
func (*GetRankRequest) GetCountry ¶
func (x *GetRankRequest) GetCountry() string
func (*GetRankRequest) GetId ¶
func (x *GetRankRequest) GetId() string
func (*GetRankRequest) ProtoMessage ¶
func (*GetRankRequest) ProtoMessage()
func (*GetRankRequest) ProtoReflect ¶
func (x *GetRankRequest) ProtoReflect() protoreflect.Message
func (*GetRankRequest) Reset ¶
func (x *GetRankRequest) Reset()
func (*GetRankRequest) String ¶
func (x *GetRankRequest) String() string
type GetRankResponse ¶
type GetRankResponse struct { Rank int64 `protobuf:"varint,1,opt,name=rank,proto3" json:"rank,omitempty"` Score float64 `protobuf:"fixed64,2,opt,name=score,proto3" json:"score,omitempty"` // contains filtered or unexported fields }
func (*GetRankResponse) Descriptor
deprecated
func (*GetRankResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetRankResponse.ProtoReflect.Descriptor instead.
func (*GetRankResponse) GetRank ¶
func (x *GetRankResponse) GetRank() int64
func (*GetRankResponse) GetScore ¶
func (x *GetRankResponse) GetScore() float64
func (*GetRankResponse) ProtoMessage ¶
func (*GetRankResponse) ProtoMessage()
func (*GetRankResponse) ProtoReflect ¶
func (x *GetRankResponse) ProtoReflect() protoreflect.Message
func (*GetRankResponse) Reset ¶
func (x *GetRankResponse) Reset()
func (*GetRankResponse) String ¶
func (x *GetRankResponse) String() string
type LeaderboardEntry ¶
type LeaderboardEntry struct { // member uid Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` // member score Score float64 `protobuf:"fixed64,2,opt,name=score,proto3" json:"score,omitempty"` // member star number Star int64 `protobuf:"varint,4,opt,name=star,proto3" json:"star,omitempty"` // contains filtered or unexported fields }
func (*LeaderboardEntry) Descriptor
deprecated
func (*LeaderboardEntry) Descriptor() ([]byte, []int)
Deprecated: Use LeaderboardEntry.ProtoReflect.Descriptor instead.
func (*LeaderboardEntry) GetScore ¶
func (x *LeaderboardEntry) GetScore() float64
func (*LeaderboardEntry) GetStar ¶
func (x *LeaderboardEntry) GetStar() int64
func (*LeaderboardEntry) GetUid ¶
func (x *LeaderboardEntry) GetUid() string
func (*LeaderboardEntry) ProtoMessage ¶
func (*LeaderboardEntry) ProtoMessage()
func (*LeaderboardEntry) ProtoReflect ¶
func (x *LeaderboardEntry) ProtoReflect() protoreflect.Message
func (*LeaderboardEntry) Reset ¶
func (x *LeaderboardEntry) Reset()
func (*LeaderboardEntry) String ¶
func (x *LeaderboardEntry) String() string
type LeaderboardPrivateServiceClient ¶
type LeaderboardPrivateServiceClient interface { // expire leaderboard,default 30 days // 实排行榜过期, 默认30天 ExpireLeaderboard(ctx context.Context, in *ExpireLeaderboardRequest, opts ...grpc.CallOption) (*ExpireLeaderboardResponse, error) // update leaderboard score // 更新排行榜分数 UpdateScore(ctx context.Context, in *UpdateScoreRequest, opts ...grpc.CallOption) (*UpdateScoreResponse, error) // clear leaderboard // 清空排行榜 ClearLeaderboard(ctx context.Context, in *ClearLeaderboardRequest, opts ...grpc.CallOption) (*ClearLeaderboardResponse, error) }
LeaderboardPrivateServiceClient is the client API for LeaderboardPrivateService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
LeaderboardPrivateService is a private service for leaderboard 排行榜私有服务, 用于管理排行榜
func NewLeaderboardPrivateServiceClient ¶
func NewLeaderboardPrivateServiceClient(cc grpc.ClientConnInterface) LeaderboardPrivateServiceClient
type LeaderboardPrivateServiceServer ¶
type LeaderboardPrivateServiceServer interface { // expire leaderboard,default 30 days // 实排行榜过期, 默认30天 ExpireLeaderboard(context.Context, *ExpireLeaderboardRequest) (*ExpireLeaderboardResponse, error) // update leaderboard score // 更新排行榜分数 UpdateScore(context.Context, *UpdateScoreRequest) (*UpdateScoreResponse, error) // clear leaderboard // 清空排行榜 ClearLeaderboard(context.Context, *ClearLeaderboardRequest) (*ClearLeaderboardResponse, error) }
LeaderboardPrivateServiceServer is the server API for LeaderboardPrivateService service. All implementations should embed UnimplementedLeaderboardPrivateServiceServer for forward compatibility
LeaderboardPrivateService is a private service for leaderboard 排行榜私有服务, 用于管理排行榜
type LeaderboardServiceClient ¶
type LeaderboardServiceClient interface { // GetLeaderboard get leaderboard entries // 获取排行榜 GetLeaderboard(ctx context.Context, in *GetLeaderboardRequest, opts ...grpc.CallOption) (*GetLeaderboardResponse, error) // GetRank get player rank // 获取玩家排名 GetRank(ctx context.Context, in *GetRankRequest, opts ...grpc.CallOption) (*GetRankResponse, error) // StarLeaderboard star a leaderboard // 点赞排行榜 StarLeaderboard(ctx context.Context, in *StarLeaderboardRequest, opts ...grpc.CallOption) (*StarLeaderboardResponse, error) }
LeaderboardServiceClient is the client API for LeaderboardService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
LeaderboardService is a service for leaderboard 排行榜服务
func NewLeaderboardServiceClient ¶
func NewLeaderboardServiceClient(cc grpc.ClientConnInterface) LeaderboardServiceClient
type LeaderboardServiceServer ¶
type LeaderboardServiceServer interface { // GetLeaderboard get leaderboard entries // 获取排行榜 GetLeaderboard(context.Context, *GetLeaderboardRequest) (*GetLeaderboardResponse, error) // GetRank get player rank // 获取玩家排名 GetRank(context.Context, *GetRankRequest) (*GetRankResponse, error) // StarLeaderboard star a leaderboard // 点赞排行榜 StarLeaderboard(context.Context, *StarLeaderboardRequest) (*StarLeaderboardResponse, error) }
LeaderboardServiceServer is the server API for LeaderboardService service. All implementations should embed UnimplementedLeaderboardServiceServer for forward compatibility
LeaderboardService is a service for leaderboard 排行榜服务
type StarLeaderboardRequest ¶
type StarLeaderboardRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // leaderboard id Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` // contains filtered or unexported fields }
func (*StarLeaderboardRequest) Descriptor
deprecated
func (*StarLeaderboardRequest) Descriptor() ([]byte, []int)
Deprecated: Use StarLeaderboardRequest.ProtoReflect.Descriptor instead.
func (*StarLeaderboardRequest) GetId ¶
func (x *StarLeaderboardRequest) GetId() string
func (*StarLeaderboardRequest) GetUid ¶
func (x *StarLeaderboardRequest) GetUid() string
func (*StarLeaderboardRequest) ProtoMessage ¶
func (*StarLeaderboardRequest) ProtoMessage()
func (*StarLeaderboardRequest) ProtoReflect ¶
func (x *StarLeaderboardRequest) ProtoReflect() protoreflect.Message
func (*StarLeaderboardRequest) Reset ¶
func (x *StarLeaderboardRequest) Reset()
func (*StarLeaderboardRequest) String ¶
func (x *StarLeaderboardRequest) String() string
type StarLeaderboardResponse ¶
type StarLeaderboardResponse struct { StarCount int64 `protobuf:"varint,1,opt,name=star_count,json=starCount,proto3" json:"star_count,omitempty"` // contains filtered or unexported fields }
func (*StarLeaderboardResponse) Descriptor
deprecated
func (*StarLeaderboardResponse) Descriptor() ([]byte, []int)
Deprecated: Use StarLeaderboardResponse.ProtoReflect.Descriptor instead.
func (*StarLeaderboardResponse) GetStarCount ¶
func (x *StarLeaderboardResponse) GetStarCount() int64
func (*StarLeaderboardResponse) ProtoMessage ¶
func (*StarLeaderboardResponse) ProtoMessage()
func (*StarLeaderboardResponse) ProtoReflect ¶
func (x *StarLeaderboardResponse) ProtoReflect() protoreflect.Message
func (*StarLeaderboardResponse) Reset ¶
func (x *StarLeaderboardResponse) Reset()
func (*StarLeaderboardResponse) String ¶
func (x *StarLeaderboardResponse) String() string
type UnimplementedLeaderboardPrivateServiceServer ¶
type UnimplementedLeaderboardPrivateServiceServer struct { }
UnimplementedLeaderboardPrivateServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedLeaderboardPrivateServiceServer) ClearLeaderboard ¶
func (UnimplementedLeaderboardPrivateServiceServer) ClearLeaderboard(context.Context, *ClearLeaderboardRequest) (*ClearLeaderboardResponse, error)
func (UnimplementedLeaderboardPrivateServiceServer) ExpireLeaderboard ¶
func (UnimplementedLeaderboardPrivateServiceServer) ExpireLeaderboard(context.Context, *ExpireLeaderboardRequest) (*ExpireLeaderboardResponse, error)
func (UnimplementedLeaderboardPrivateServiceServer) UpdateScore ¶
func (UnimplementedLeaderboardPrivateServiceServer) UpdateScore(context.Context, *UpdateScoreRequest) (*UpdateScoreResponse, error)
type UnimplementedLeaderboardServiceServer ¶
type UnimplementedLeaderboardServiceServer struct { }
UnimplementedLeaderboardServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedLeaderboardServiceServer) GetLeaderboard ¶
func (UnimplementedLeaderboardServiceServer) GetLeaderboard(context.Context, *GetLeaderboardRequest) (*GetLeaderboardResponse, error)
func (UnimplementedLeaderboardServiceServer) GetRank ¶
func (UnimplementedLeaderboardServiceServer) GetRank(context.Context, *GetRankRequest) (*GetRankResponse, error)
func (UnimplementedLeaderboardServiceServer) StarLeaderboard ¶
func (UnimplementedLeaderboardServiceServer) StarLeaderboard(context.Context, *StarLeaderboardRequest) (*StarLeaderboardResponse, error)
type UnsafeLeaderboardPrivateServiceServer ¶
type UnsafeLeaderboardPrivateServiceServer interface {
// contains filtered or unexported methods
}
UnsafeLeaderboardPrivateServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to LeaderboardPrivateServiceServer will result in compilation errors.
type UnsafeLeaderboardServiceServer ¶
type UnsafeLeaderboardServiceServer interface {
// contains filtered or unexported methods
}
UnsafeLeaderboardServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to LeaderboardServiceServer will result in compilation errors.
type UpdateScoreRequest ¶
type UpdateScoreRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // leaderboard id Scores map[string]float64 `` // uid -> score /* 155-byte string literal not displayed */ UpdateType UpdateScoreRequest_UpdateType `` // default ADD /* 142-byte string literal not displayed */ // contains filtered or unexported fields }
func (*UpdateScoreRequest) Descriptor
deprecated
func (*UpdateScoreRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateScoreRequest.ProtoReflect.Descriptor instead.
func (*UpdateScoreRequest) GetId ¶
func (x *UpdateScoreRequest) GetId() string
func (*UpdateScoreRequest) GetScores ¶
func (x *UpdateScoreRequest) GetScores() map[string]float64
func (*UpdateScoreRequest) GetUpdateType ¶
func (x *UpdateScoreRequest) GetUpdateType() UpdateScoreRequest_UpdateType
func (*UpdateScoreRequest) ProtoMessage ¶
func (*UpdateScoreRequest) ProtoMessage()
func (*UpdateScoreRequest) ProtoReflect ¶
func (x *UpdateScoreRequest) ProtoReflect() protoreflect.Message
func (*UpdateScoreRequest) Reset ¶
func (x *UpdateScoreRequest) Reset()
func (*UpdateScoreRequest) String ¶
func (x *UpdateScoreRequest) String() string
type UpdateScoreRequest_UpdateType ¶
type UpdateScoreRequest_UpdateType int32
const ( // add score default UpdateScoreRequest_ADD UpdateScoreRequest_UpdateType = 0 // replace when greater than old score UpdateScoreRequest_GTR UpdateScoreRequest_UpdateType = 1 // replace when less than old score UpdateScoreRequest_LSR UpdateScoreRequest_UpdateType = 2 )
func (UpdateScoreRequest_UpdateType) Descriptor ¶
func (UpdateScoreRequest_UpdateType) Descriptor() protoreflect.EnumDescriptor
func (UpdateScoreRequest_UpdateType) Enum ¶
func (x UpdateScoreRequest_UpdateType) Enum() *UpdateScoreRequest_UpdateType
func (UpdateScoreRequest_UpdateType) EnumDescriptor
deprecated
func (UpdateScoreRequest_UpdateType) EnumDescriptor() ([]byte, []int)
Deprecated: Use UpdateScoreRequest_UpdateType.Descriptor instead.
func (UpdateScoreRequest_UpdateType) Number ¶
func (x UpdateScoreRequest_UpdateType) Number() protoreflect.EnumNumber
func (UpdateScoreRequest_UpdateType) String ¶
func (x UpdateScoreRequest_UpdateType) String() string
func (UpdateScoreRequest_UpdateType) Type ¶
func (UpdateScoreRequest_UpdateType) Type() protoreflect.EnumType
type UpdateScoreResponse ¶
type UpdateScoreResponse struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` //leaderboard id OldUid string `protobuf:"bytes,2,opt,name=old_uid,json=oldUid,proto3" json:"old_uid,omitempty"` //old player uid CurrentUid string `protobuf:"bytes,3,opt,name=current_uid,json=currentUid,proto3" json:"current_uid,omitempty"` //current player uid // contains filtered or unexported fields }
func (*UpdateScoreResponse) Descriptor
deprecated
func (*UpdateScoreResponse) Descriptor() ([]byte, []int)
Deprecated: Use UpdateScoreResponse.ProtoReflect.Descriptor instead.
func (*UpdateScoreResponse) GetCurrentUid ¶
func (x *UpdateScoreResponse) GetCurrentUid() string
func (*UpdateScoreResponse) GetId ¶
func (x *UpdateScoreResponse) GetId() string
func (*UpdateScoreResponse) GetOldUid ¶
func (x *UpdateScoreResponse) GetOldUid() string
func (*UpdateScoreResponse) ProtoMessage ¶
func (*UpdateScoreResponse) ProtoMessage()
func (*UpdateScoreResponse) ProtoReflect ¶
func (x *UpdateScoreResponse) ProtoReflect() protoreflect.Message
func (*UpdateScoreResponse) Reset ¶
func (x *UpdateScoreResponse) Reset()
func (*UpdateScoreResponse) String ¶
func (x *UpdateScoreResponse) String() string