feat: initial commit
This commit is contained in:
@@ -0,0 +1,207 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc v7.35.0
|
||||
// source: scoreboard/v1/scoreboard.proto
|
||||
|
||||
package scoreboardv1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
ScoreboardService_ListScoreboard_FullMethodName = "/scoreboard.v1.ScoreboardService/ListScoreboard"
|
||||
ScoreboardService_GetByRank_FullMethodName = "/scoreboard.v1.ScoreboardService/GetByRank"
|
||||
ScoreboardService_GetByUsername_FullMethodName = "/scoreboard.v1.ScoreboardService/GetByUsername"
|
||||
)
|
||||
|
||||
// ScoreboardServiceClient is the client API for ScoreboardService 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.
|
||||
//
|
||||
// ScoreboardService serves the cached root-me.org scoreboard.
|
||||
type ScoreboardServiceClient interface {
|
||||
// ListScoreboard returns a page of entries ordered by rank.
|
||||
ListScoreboard(ctx context.Context, in *ListScoreboardRequest, opts ...grpc.CallOption) (*ListScoreboardResponse, error)
|
||||
// GetByRank returns the entry at the given canonical rank.
|
||||
GetByRank(ctx context.Context, in *GetByRankRequest, opts ...grpc.CallOption) (*Entry, error)
|
||||
// GetByUsername returns the entry for a username (case-insensitive).
|
||||
GetByUsername(ctx context.Context, in *GetByUsernameRequest, opts ...grpc.CallOption) (*Entry, error)
|
||||
}
|
||||
|
||||
type scoreboardServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewScoreboardServiceClient(cc grpc.ClientConnInterface) ScoreboardServiceClient {
|
||||
return &scoreboardServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *scoreboardServiceClient) ListScoreboard(ctx context.Context, in *ListScoreboardRequest, opts ...grpc.CallOption) (*ListScoreboardResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListScoreboardResponse)
|
||||
err := c.cc.Invoke(ctx, ScoreboardService_ListScoreboard_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *scoreboardServiceClient) GetByRank(ctx context.Context, in *GetByRankRequest, opts ...grpc.CallOption) (*Entry, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Entry)
|
||||
err := c.cc.Invoke(ctx, ScoreboardService_GetByRank_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *scoreboardServiceClient) GetByUsername(ctx context.Context, in *GetByUsernameRequest, opts ...grpc.CallOption) (*Entry, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Entry)
|
||||
err := c.cc.Invoke(ctx, ScoreboardService_GetByUsername_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ScoreboardServiceServer is the server API for ScoreboardService service.
|
||||
// All implementations must embed UnimplementedScoreboardServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// ScoreboardService serves the cached root-me.org scoreboard.
|
||||
type ScoreboardServiceServer interface {
|
||||
// ListScoreboard returns a page of entries ordered by rank.
|
||||
ListScoreboard(context.Context, *ListScoreboardRequest) (*ListScoreboardResponse, error)
|
||||
// GetByRank returns the entry at the given canonical rank.
|
||||
GetByRank(context.Context, *GetByRankRequest) (*Entry, error)
|
||||
// GetByUsername returns the entry for a username (case-insensitive).
|
||||
GetByUsername(context.Context, *GetByUsernameRequest) (*Entry, error)
|
||||
mustEmbedUnimplementedScoreboardServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedScoreboardServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedScoreboardServiceServer struct{}
|
||||
|
||||
func (UnimplementedScoreboardServiceServer) ListScoreboard(context.Context, *ListScoreboardRequest) (*ListScoreboardResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListScoreboard not implemented")
|
||||
}
|
||||
func (UnimplementedScoreboardServiceServer) GetByRank(context.Context, *GetByRankRequest) (*Entry, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetByRank not implemented")
|
||||
}
|
||||
func (UnimplementedScoreboardServiceServer) GetByUsername(context.Context, *GetByUsernameRequest) (*Entry, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetByUsername not implemented")
|
||||
}
|
||||
func (UnimplementedScoreboardServiceServer) mustEmbedUnimplementedScoreboardServiceServer() {}
|
||||
func (UnimplementedScoreboardServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeScoreboardServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ScoreboardServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeScoreboardServiceServer interface {
|
||||
mustEmbedUnimplementedScoreboardServiceServer()
|
||||
}
|
||||
|
||||
func RegisterScoreboardServiceServer(s grpc.ServiceRegistrar, srv ScoreboardServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedScoreboardServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&ScoreboardService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ScoreboardService_ListScoreboard_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListScoreboardRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ScoreboardServiceServer).ListScoreboard(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ScoreboardService_ListScoreboard_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ScoreboardServiceServer).ListScoreboard(ctx, req.(*ListScoreboardRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ScoreboardService_GetByRank_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetByRankRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ScoreboardServiceServer).GetByRank(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ScoreboardService_GetByRank_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ScoreboardServiceServer).GetByRank(ctx, req.(*GetByRankRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ScoreboardService_GetByUsername_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetByUsernameRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ScoreboardServiceServer).GetByUsername(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ScoreboardService_GetByUsername_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ScoreboardServiceServer).GetByUsername(ctx, req.(*GetByUsernameRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ScoreboardService_ServiceDesc is the grpc.ServiceDesc for ScoreboardService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ScoreboardService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "scoreboard.v1.ScoreboardService",
|
||||
HandlerType: (*ScoreboardServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "ListScoreboard",
|
||||
Handler: _ScoreboardService_ListScoreboard_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetByRank",
|
||||
Handler: _ScoreboardService_GetByRank_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetByUsername",
|
||||
Handler: _ScoreboardService_GetByUsername_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "scoreboard/v1/scoreboard.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user