leaderboard

package
v0.0.0-...-cd9d53d Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_leaderboards_grpc_proto protoreflect.FileDescriptor
View Source
var Leaderboard_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "emortal.grpc.leaderboard.Leaderboard",
	HandlerType: (*LeaderboardServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateLeaderboard",
			Handler:    _Leaderboard_CreateLeaderboard_Handler,
		},
		{
			MethodName: "DeleteLeaderboard",
			Handler:    _Leaderboard_DeleteLeaderboard_Handler,
		},
		{
			MethodName: "GetEntries",
			Handler:    _Leaderboard_GetEntries_Handler,
		},
		{
			MethodName: "GetEntryCount",
			Handler:    _Leaderboard_GetEntryCount_Handler,
		},
		{
			MethodName: "CreateEntry",
			Handler:    _Leaderboard_CreateEntry_Handler,
		},
		{
			MethodName: "DeleteEntry",
			Handler:    _Leaderboard_DeleteEntry_Handler,
		},
		{
			MethodName: "UpdateScore",
			Handler:    _Leaderboard_UpdateScore_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "leaderboards/grpc.proto",
}

Leaderboard_ServiceDesc is the grpc.ServiceDesc for Leaderboard service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterLeaderboardServer

func RegisterLeaderboardServer(s grpc.ServiceRegistrar, srv LeaderboardServer)

Types

type CreateEntryRequest

type CreateEntryRequest struct {
	LeaderboardId string                `protobuf:"bytes,1,opt,name=leaderboard_id,json=leaderboardId,proto3" json:"leaderboard_id,omitempty"`
	EntryId       string                `protobuf:"bytes,2,opt,name=entry_id,json=entryId,proto3" json:"entry_id,omitempty"`
	Score         float64               `protobuf:"fixed64,3,opt,name=score,proto3" json:"score,omitempty"`
	Data          map[string]*anypb.Any `` /* 149-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*CreateEntryRequest) Descriptor deprecated

func (*CreateEntryRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateEntryRequest.ProtoReflect.Descriptor instead.

func (*CreateEntryRequest) GetData

func (x *CreateEntryRequest) GetData() map[string]*anypb.Any

func (*CreateEntryRequest) GetEntryId

func (x *CreateEntryRequest) GetEntryId() string

func (*CreateEntryRequest) GetLeaderboardId

func (x *CreateEntryRequest) GetLeaderboardId() string

func (*CreateEntryRequest) GetScore

func (x *CreateEntryRequest) GetScore() float64

func (*CreateEntryRequest) ProtoMessage

func (*CreateEntryRequest) ProtoMessage()

func (*CreateEntryRequest) ProtoReflect

func (x *CreateEntryRequest) ProtoReflect() protoreflect.Message

func (*CreateEntryRequest) Reset

func (x *CreateEntryRequest) Reset()

func (*CreateEntryRequest) String

func (x *CreateEntryRequest) String() string

type CreateEntryResponse

type CreateEntryResponse struct {
	// contains filtered or unexported fields
}

func (*CreateEntryResponse) Descriptor deprecated

func (*CreateEntryResponse) Descriptor() ([]byte, []int)

Deprecated: Use CreateEntryResponse.ProtoReflect.Descriptor instead.

func (*CreateEntryResponse) ProtoMessage

func (*CreateEntryResponse) ProtoMessage()

func (*CreateEntryResponse) ProtoReflect

func (x *CreateEntryResponse) ProtoReflect() protoreflect.Message

func (*CreateEntryResponse) Reset

func (x *CreateEntryResponse) Reset()

func (*CreateEntryResponse) String

func (x *CreateEntryResponse) String() string

type CreateLeaderboardRequest

type CreateLeaderboardRequest struct {
	Leaderboard *leaderboard.Leaderboard `protobuf:"bytes,1,opt,name=leaderboard,proto3" json:"leaderboard,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateLeaderboardRequest) Descriptor deprecated

func (*CreateLeaderboardRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateLeaderboardRequest.ProtoReflect.Descriptor instead.

func (*CreateLeaderboardRequest) GetLeaderboard

func (x *CreateLeaderboardRequest) GetLeaderboard() *leaderboard.Leaderboard

func (*CreateLeaderboardRequest) ProtoMessage

func (*CreateLeaderboardRequest) ProtoMessage()

func (*CreateLeaderboardRequest) ProtoReflect

func (x *CreateLeaderboardRequest) ProtoReflect() protoreflect.Message

func (*CreateLeaderboardRequest) Reset

func (x *CreateLeaderboardRequest) Reset()

func (*CreateLeaderboardRequest) String

func (x *CreateLeaderboardRequest) String() string

type CreateLeaderboardResponse

type CreateLeaderboardResponse struct {
	// contains filtered or unexported fields
}

func (*CreateLeaderboardResponse) Descriptor deprecated

func (*CreateLeaderboardResponse) Descriptor() ([]byte, []int)

Deprecated: Use CreateLeaderboardResponse.ProtoReflect.Descriptor instead.

func (*CreateLeaderboardResponse) ProtoMessage

func (*CreateLeaderboardResponse) ProtoMessage()

func (*CreateLeaderboardResponse) ProtoReflect

func (*CreateLeaderboardResponse) Reset

func (x *CreateLeaderboardResponse) Reset()

func (*CreateLeaderboardResponse) String

func (x *CreateLeaderboardResponse) String() string

type DeleteEntryRequest

type DeleteEntryRequest struct {
	LeaderboardId string `protobuf:"bytes,1,opt,name=leaderboard_id,json=leaderboardId,proto3" json:"leaderboard_id,omitempty"`
	EntryId       string `protobuf:"bytes,2,opt,name=entry_id,json=entryId,proto3" json:"entry_id,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteEntryRequest) Descriptor deprecated

func (*DeleteEntryRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeleteEntryRequest.ProtoReflect.Descriptor instead.

func (*DeleteEntryRequest) GetEntryId

func (x *DeleteEntryRequest) GetEntryId() string

func (*DeleteEntryRequest) GetLeaderboardId

func (x *DeleteEntryRequest) GetLeaderboardId() string

func (*DeleteEntryRequest) ProtoMessage

func (*DeleteEntryRequest) ProtoMessage()

func (*DeleteEntryRequest) ProtoReflect

func (x *DeleteEntryRequest) ProtoReflect() protoreflect.Message

func (*DeleteEntryRequest) Reset

func (x *DeleteEntryRequest) Reset()

func (*DeleteEntryRequest) String

func (x *DeleteEntryRequest) String() string

type DeleteEntryResponse

type DeleteEntryResponse struct {
	// contains filtered or unexported fields
}

func (*DeleteEntryResponse) Descriptor deprecated

func (*DeleteEntryResponse) Descriptor() ([]byte, []int)

Deprecated: Use DeleteEntryResponse.ProtoReflect.Descriptor instead.

func (*DeleteEntryResponse) ProtoMessage

func (*DeleteEntryResponse) ProtoMessage()

func (*DeleteEntryResponse) ProtoReflect

func (x *DeleteEntryResponse) ProtoReflect() protoreflect.Message

func (*DeleteEntryResponse) Reset

func (x *DeleteEntryResponse) Reset()

func (*DeleteEntryResponse) String

func (x *DeleteEntryResponse) String() string

type DeleteLeaderboardRequest

type DeleteLeaderboardRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteLeaderboardRequest) Descriptor deprecated

func (*DeleteLeaderboardRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeleteLeaderboardRequest.ProtoReflect.Descriptor instead.

func (*DeleteLeaderboardRequest) GetId

func (x *DeleteLeaderboardRequest) GetId() string

func (*DeleteLeaderboardRequest) ProtoMessage

func (*DeleteLeaderboardRequest) ProtoMessage()

func (*DeleteLeaderboardRequest) ProtoReflect

func (x *DeleteLeaderboardRequest) ProtoReflect() protoreflect.Message

func (*DeleteLeaderboardRequest) Reset

func (x *DeleteLeaderboardRequest) Reset()

func (*DeleteLeaderboardRequest) String

func (x *DeleteLeaderboardRequest) String() string

type DeleteLeaderboardResponse

type DeleteLeaderboardResponse struct {
	// contains filtered or unexported fields
}

func (*DeleteLeaderboardResponse) Descriptor deprecated

func (*DeleteLeaderboardResponse) Descriptor() ([]byte, []int)

Deprecated: Use DeleteLeaderboardResponse.ProtoReflect.Descriptor instead.

func (*DeleteLeaderboardResponse) ProtoMessage

func (*DeleteLeaderboardResponse) ProtoMessage()

func (*DeleteLeaderboardResponse) ProtoReflect

func (*DeleteLeaderboardResponse) Reset

func (x *DeleteLeaderboardResponse) Reset()

func (*DeleteLeaderboardResponse) String

func (x *DeleteLeaderboardResponse) String() string

type GetEntriesRequest

type GetEntriesRequest struct {
	LeaderboardId string `protobuf:"bytes,1,opt,name=leaderboard_id,json=leaderboardId,proto3" json:"leaderboard_id,omitempty"`
	// The start and end rank indicate the range of entries to return, where the rank is the
	// ranking in the leaderboard
	StartRank uint32 `protobuf:"varint,2,opt,name=start_rank,json=startRank,proto3" json:"start_rank,omitempty"`
	EndRank   uint32 `protobuf:"varint,3,opt,name=end_rank,json=endRank,proto3" json:"end_rank,omitempty"`
	// contains filtered or unexported fields
}

func (*GetEntriesRequest) Descriptor deprecated

func (*GetEntriesRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetEntriesRequest.ProtoReflect.Descriptor instead.

func (*GetEntriesRequest) GetEndRank

func (x *GetEntriesRequest) GetEndRank() uint32

func (*GetEntriesRequest) GetLeaderboardId

func (x *GetEntriesRequest) GetLeaderboardId() string

func (*GetEntriesRequest) GetStartRank

func (x *GetEntriesRequest) GetStartRank() uint32

func (*GetEntriesRequest) ProtoMessage

func (*GetEntriesRequest) ProtoMessage()

func (*GetEntriesRequest) ProtoReflect

func (x *GetEntriesRequest) ProtoReflect() protoreflect.Message

func (*GetEntriesRequest) Reset

func (x *GetEntriesRequest) Reset()

func (*GetEntriesRequest) String

func (x *GetEntriesRequest) String() string

type GetEntriesResponse

type GetEntriesResponse struct {
	Entries []*leaderboard.LeaderboardEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"`
	// contains filtered or unexported fields
}

func (*GetEntriesResponse) Descriptor deprecated

func (*GetEntriesResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetEntriesResponse.ProtoReflect.Descriptor instead.

func (*GetEntriesResponse) GetEntries

func (x *GetEntriesResponse) GetEntries() []*leaderboard.LeaderboardEntry

func (*GetEntriesResponse) ProtoMessage

func (*GetEntriesResponse) ProtoMessage()

func (*GetEntriesResponse) ProtoReflect

func (x *GetEntriesResponse) ProtoReflect() protoreflect.Message

func (*GetEntriesResponse) Reset

func (x *GetEntriesResponse) Reset()

func (*GetEntriesResponse) String

func (x *GetEntriesResponse) String() string

type GetEntryCountRequest

type GetEntryCountRequest struct {
	LeaderboardId string `protobuf:"bytes,1,opt,name=leaderboard_id,json=leaderboardId,proto3" json:"leaderboard_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetEntryCountRequest) Descriptor deprecated

func (*GetEntryCountRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetEntryCountRequest.ProtoReflect.Descriptor instead.

func (*GetEntryCountRequest) GetLeaderboardId

func (x *GetEntryCountRequest) GetLeaderboardId() string

func (*GetEntryCountRequest) ProtoMessage

func (*GetEntryCountRequest) ProtoMessage()

func (*GetEntryCountRequest) ProtoReflect

func (x *GetEntryCountRequest) ProtoReflect() protoreflect.Message

func (*GetEntryCountRequest) Reset

func (x *GetEntryCountRequest) Reset()

func (*GetEntryCountRequest) String

func (x *GetEntryCountRequest) String() string

type GetEntryCountResponse

type GetEntryCountResponse struct {
	Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
	// contains filtered or unexported fields
}

func (*GetEntryCountResponse) Descriptor deprecated

func (*GetEntryCountResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetEntryCountResponse.ProtoReflect.Descriptor instead.

func (*GetEntryCountResponse) GetCount

func (x *GetEntryCountResponse) GetCount() uint32

func (*GetEntryCountResponse) ProtoMessage

func (*GetEntryCountResponse) ProtoMessage()

func (*GetEntryCountResponse) ProtoReflect

func (x *GetEntryCountResponse) ProtoReflect() protoreflect.Message

func (*GetEntryCountResponse) Reset

func (x *GetEntryCountResponse) Reset()

func (*GetEntryCountResponse) String

func (x *GetEntryCountResponse) String() string

type LeaderboardClient

type LeaderboardClient interface {
	CreateLeaderboard(ctx context.Context, in *CreateLeaderboardRequest, opts ...grpc.CallOption) (*CreateLeaderboardResponse, error)
	// If the leaderboard does not exist, an error with status NOT_FOUND is returned.
	DeleteLeaderboard(ctx context.Context, in *DeleteLeaderboardRequest, opts ...grpc.CallOption) (*DeleteLeaderboardResponse, error)
	// If the leaderboard does not exist, an error with status NOT_FOUND is returned.
	// If the start place is greater than the end place, an error with status INVALID_ARGUMENT is returned.
	// If the end place is greater than the number of entries in the leaderboard, an error with status INVALID_ARGUMENT is returned.
	GetEntries(ctx context.Context, in *GetEntriesRequest, opts ...grpc.CallOption) (*GetEntriesResponse, error)
	// If the leaderboard does not exist, an error with status NOT_FOUND is returned.
	GetEntryCount(ctx context.Context, in *GetEntryCountRequest, opts ...grpc.CallOption) (*GetEntryCountResponse, error)
	CreateEntry(ctx context.Context, in *CreateEntryRequest, opts ...grpc.CallOption) (*CreateEntryResponse, error)
	// If the leaderboard or entry does not exist, an error with status NOT_FOUND is returned.
	DeleteEntry(ctx context.Context, in *DeleteEntryRequest, opts ...grpc.CallOption) (*DeleteEntryResponse, error)
	// If the leaderboard or entry does not exist, an error with status NOT_FOUND is returned.
	UpdateScore(ctx context.Context, in *UpdateScoreRequest, opts ...grpc.CallOption) (*UpdateScoreResponse, error)
}

LeaderboardClient is the client API for Leaderboard 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.

type LeaderboardServer

type LeaderboardServer interface {
	CreateLeaderboard(context.Context, *CreateLeaderboardRequest) (*CreateLeaderboardResponse, error)
	// If the leaderboard does not exist, an error with status NOT_FOUND is returned.
	DeleteLeaderboard(context.Context, *DeleteLeaderboardRequest) (*DeleteLeaderboardResponse, error)
	// If the leaderboard does not exist, an error with status NOT_FOUND is returned.
	// If the start place is greater than the end place, an error with status INVALID_ARGUMENT is returned.
	// If the end place is greater than the number of entries in the leaderboard, an error with status INVALID_ARGUMENT is returned.
	GetEntries(context.Context, *GetEntriesRequest) (*GetEntriesResponse, error)
	// If the leaderboard does not exist, an error with status NOT_FOUND is returned.
	GetEntryCount(context.Context, *GetEntryCountRequest) (*GetEntryCountResponse, error)
	CreateEntry(context.Context, *CreateEntryRequest) (*CreateEntryResponse, error)
	// If the leaderboard or entry does not exist, an error with status NOT_FOUND is returned.
	DeleteEntry(context.Context, *DeleteEntryRequest) (*DeleteEntryResponse, error)
	// If the leaderboard or entry does not exist, an error with status NOT_FOUND is returned.
	UpdateScore(context.Context, *UpdateScoreRequest) (*UpdateScoreResponse, error)
	// contains filtered or unexported methods
}

LeaderboardServer is the server API for Leaderboard service. All implementations must embed UnimplementedLeaderboardServer for forward compatibility

type UnimplementedLeaderboardServer

type UnimplementedLeaderboardServer struct {
}

UnimplementedLeaderboardServer must be embedded to have forward compatible implementations.

func (UnimplementedLeaderboardServer) CreateEntry

func (UnimplementedLeaderboardServer) CreateLeaderboard

func (UnimplementedLeaderboardServer) DeleteEntry

func (UnimplementedLeaderboardServer) DeleteLeaderboard

func (UnimplementedLeaderboardServer) GetEntries

func (UnimplementedLeaderboardServer) GetEntryCount

func (UnimplementedLeaderboardServer) UpdateScore

type UnsafeLeaderboardServer

type UnsafeLeaderboardServer interface {
	// contains filtered or unexported methods
}

UnsafeLeaderboardServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to LeaderboardServer will result in compilation errors.

type UpdateScoreRequest

type UpdateScoreRequest struct {
	LeaderboardId string  `protobuf:"bytes,1,opt,name=leaderboard_id,json=leaderboardId,proto3" json:"leaderboard_id,omitempty"`
	EntryId       string  `protobuf:"bytes,2,opt,name=entry_id,json=entryId,proto3" json:"entry_id,omitempty"`
	Score         float64 `protobuf:"fixed64,3,opt,name=score,proto3" json:"score,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateScoreRequest) Descriptor deprecated

func (*UpdateScoreRequest) Descriptor() ([]byte, []int)

Deprecated: Use UpdateScoreRequest.ProtoReflect.Descriptor instead.

func (*UpdateScoreRequest) GetEntryId

func (x *UpdateScoreRequest) GetEntryId() string

func (*UpdateScoreRequest) GetLeaderboardId

func (x *UpdateScoreRequest) GetLeaderboardId() string

func (*UpdateScoreRequest) GetScore

func (x *UpdateScoreRequest) GetScore() float64

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 UpdateScoreResponse

type UpdateScoreResponse struct {
	// contains filtered or unexported fields
}

func (*UpdateScoreResponse) Descriptor deprecated

func (*UpdateScoreResponse) Descriptor() ([]byte, []int)

Deprecated: Use UpdateScoreResponse.ProtoReflect.Descriptor instead.

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

Jump to

Keyboard shortcuts

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