chore: updated grpc stubs
This commit is contained in:
@@ -0,0 +1,415 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v6.33.2
|
||||
// source: api/proto/user.proto
|
||||
|
||||
package user
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type User struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
|
||||
Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
|
||||
FullName *string `protobuf:"bytes,4,opt,name=full_name,json=fullName,proto3,oneof" json:"full_name,omitempty"`
|
||||
AvatarUrl *string `protobuf:"bytes,5,opt,name=avatar_url,json=avatarUrl,proto3,oneof" json:"avatar_url,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *User) Reset() {
|
||||
*x = User{}
|
||||
mi := &file_api_proto_user_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *User) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*User) ProtoMessage() {}
|
||||
|
||||
func (x *User) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_user_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use User.ProtoReflect.Descriptor instead.
|
||||
func (*User) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_user_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *User) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetUsername() string {
|
||||
if x != nil {
|
||||
return x.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetEmail() string {
|
||||
if x != nil {
|
||||
return x.Email
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetFullName() string {
|
||||
if x != nil && x.FullName != nil {
|
||||
return *x.FullName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetAvatarUrl() string {
|
||||
if x != nil && x.AvatarUrl != nil {
|
||||
return *x.AvatarUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetProfileRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetProfileRequest) Reset() {
|
||||
*x = GetProfileRequest{}
|
||||
mi := &file_api_proto_user_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetProfileRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetProfileRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetProfileRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_user_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetProfileRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetProfileRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_user_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *GetProfileRequest) GetUserId() string {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type RegisterForCompetitionRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
CompetitionId string `protobuf:"bytes,1,opt,name=competition_id,json=competitionId,proto3" json:"competition_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RegisterForCompetitionRequest) Reset() {
|
||||
*x = RegisterForCompetitionRequest{}
|
||||
mi := &file_api_proto_user_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RegisterForCompetitionRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RegisterForCompetitionRequest) ProtoMessage() {}
|
||||
|
||||
func (x *RegisterForCompetitionRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_user_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RegisterForCompetitionRequest.ProtoReflect.Descriptor instead.
|
||||
func (*RegisterForCompetitionRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_user_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *RegisterForCompetitionRequest) GetCompetitionId() string {
|
||||
if x != nil {
|
||||
return x.CompetitionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type UnregisterFromCompetitionRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
CompetitionId string `protobuf:"bytes,1,opt,name=competition_id,json=competitionId,proto3" json:"competition_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *UnregisterFromCompetitionRequest) Reset() {
|
||||
*x = UnregisterFromCompetitionRequest{}
|
||||
mi := &file_api_proto_user_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *UnregisterFromCompetitionRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UnregisterFromCompetitionRequest) ProtoMessage() {}
|
||||
|
||||
func (x *UnregisterFromCompetitionRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_user_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use UnregisterFromCompetitionRequest.ProtoReflect.Descriptor instead.
|
||||
func (*UnregisterFromCompetitionRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_user_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *UnregisterFromCompetitionRequest) GetCompetitionId() string {
|
||||
if x != nil {
|
||||
return x.CompetitionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ListUserCompetitionsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListUserCompetitionsRequest) Reset() {
|
||||
*x = ListUserCompetitionsRequest{}
|
||||
mi := &file_api_proto_user_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListUserCompetitionsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListUserCompetitionsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ListUserCompetitionsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_user_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListUserCompetitionsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListUserCompetitionsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_user_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *ListUserCompetitionsRequest) GetUserId() string {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ListUserCompetitionsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
CompetitionIds []string `protobuf:"bytes,1,rep,name=competition_ids,json=competitionIds,proto3" json:"competition_ids,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListUserCompetitionsResponse) Reset() {
|
||||
*x = ListUserCompetitionsResponse{}
|
||||
mi := &file_api_proto_user_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListUserCompetitionsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListUserCompetitionsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListUserCompetitionsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_user_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListUserCompetitionsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListUserCompetitionsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_user_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *ListUserCompetitionsResponse) GetCompetitionIds() []string {
|
||||
if x != nil {
|
||||
return x.CompetitionIds
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_api_proto_user_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_api_proto_user_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x14api/proto/user.proto\x12\x04user\x1a\x1bgoogle/protobuf/empty.proto\"\xab\x01\n" +
|
||||
"\x04User\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n" +
|
||||
"\busername\x18\x02 \x01(\tR\busername\x12\x14\n" +
|
||||
"\x05email\x18\x03 \x01(\tR\x05email\x12 \n" +
|
||||
"\tfull_name\x18\x04 \x01(\tH\x00R\bfullName\x88\x01\x01\x12\"\n" +
|
||||
"\n" +
|
||||
"avatar_url\x18\x05 \x01(\tH\x01R\tavatarUrl\x88\x01\x01B\f\n" +
|
||||
"\n" +
|
||||
"_full_nameB\r\n" +
|
||||
"\v_avatar_url\",\n" +
|
||||
"\x11GetProfileRequest\x12\x17\n" +
|
||||
"\auser_id\x18\x01 \x01(\tR\x06userId\"F\n" +
|
||||
"\x1dRegisterForCompetitionRequest\x12%\n" +
|
||||
"\x0ecompetition_id\x18\x01 \x01(\tR\rcompetitionId\"I\n" +
|
||||
" UnregisterFromCompetitionRequest\x12%\n" +
|
||||
"\x0ecompetition_id\x18\x01 \x01(\tR\rcompetitionId\"6\n" +
|
||||
"\x1bListUserCompetitionsRequest\x12\x17\n" +
|
||||
"\auser_id\x18\x01 \x01(\tR\x06userId\"G\n" +
|
||||
"\x1cListUserCompetitionsResponse\x12'\n" +
|
||||
"\x0fcompetition_ids\x18\x01 \x03(\tR\x0ecompetitionIds2\xd3\x02\n" +
|
||||
"\vUserService\x121\n" +
|
||||
"\n" +
|
||||
"GetProfile\x12\x17.user.GetProfileRequest\x1a\n" +
|
||||
".user.User\x12U\n" +
|
||||
"\x16RegisterForCompetition\x12#.user.RegisterForCompetitionRequest\x1a\x16.google.protobuf.Empty\x12[\n" +
|
||||
"\x19UnregisterFromCompetition\x12&.user.UnregisterFromCompetitionRequest\x1a\x16.google.protobuf.Empty\x12]\n" +
|
||||
"\x14ListUserCompetitions\x12!.user.ListUserCompetitionsRequest\x1a\".user.ListUserCompetitionsResponseB\x0eZ\fpkg/api/userb\x06proto3"
|
||||
|
||||
var (
|
||||
file_api_proto_user_proto_rawDescOnce sync.Once
|
||||
file_api_proto_user_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_api_proto_user_proto_rawDescGZIP() []byte {
|
||||
file_api_proto_user_proto_rawDescOnce.Do(func() {
|
||||
file_api_proto_user_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_api_proto_user_proto_rawDesc), len(file_api_proto_user_proto_rawDesc)))
|
||||
})
|
||||
return file_api_proto_user_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_api_proto_user_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_api_proto_user_proto_goTypes = []any{
|
||||
(*User)(nil), // 0: user.User
|
||||
(*GetProfileRequest)(nil), // 1: user.GetProfileRequest
|
||||
(*RegisterForCompetitionRequest)(nil), // 2: user.RegisterForCompetitionRequest
|
||||
(*UnregisterFromCompetitionRequest)(nil), // 3: user.UnregisterFromCompetitionRequest
|
||||
(*ListUserCompetitionsRequest)(nil), // 4: user.ListUserCompetitionsRequest
|
||||
(*ListUserCompetitionsResponse)(nil), // 5: user.ListUserCompetitionsResponse
|
||||
(*emptypb.Empty)(nil), // 6: google.protobuf.Empty
|
||||
}
|
||||
var file_api_proto_user_proto_depIdxs = []int32{
|
||||
1, // 0: user.UserService.GetProfile:input_type -> user.GetProfileRequest
|
||||
2, // 1: user.UserService.RegisterForCompetition:input_type -> user.RegisterForCompetitionRequest
|
||||
3, // 2: user.UserService.UnregisterFromCompetition:input_type -> user.UnregisterFromCompetitionRequest
|
||||
4, // 3: user.UserService.ListUserCompetitions:input_type -> user.ListUserCompetitionsRequest
|
||||
0, // 4: user.UserService.GetProfile:output_type -> user.User
|
||||
6, // 5: user.UserService.RegisterForCompetition:output_type -> google.protobuf.Empty
|
||||
6, // 6: user.UserService.UnregisterFromCompetition:output_type -> google.protobuf.Empty
|
||||
5, // 7: user.UserService.ListUserCompetitions:output_type -> user.ListUserCompetitionsResponse
|
||||
4, // [4:8] is the sub-list for method output_type
|
||||
0, // [0:4] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_proto_user_proto_init() }
|
||||
func file_api_proto_user_proto_init() {
|
||||
if File_api_proto_user_proto != nil {
|
||||
return
|
||||
}
|
||||
file_api_proto_user_proto_msgTypes[0].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_proto_user_proto_rawDesc), len(file_api_proto_user_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_api_proto_user_proto_goTypes,
|
||||
DependencyIndexes: file_api_proto_user_proto_depIdxs,
|
||||
MessageInfos: file_api_proto_user_proto_msgTypes,
|
||||
}.Build()
|
||||
File_api_proto_user_proto = out.File
|
||||
file_api_proto_user_proto_goTypes = nil
|
||||
file_api_proto_user_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,236 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v6.33.2
|
||||
// source: api/proto/user.proto
|
||||
|
||||
package user
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// 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 (
|
||||
UserService_GetProfile_FullMethodName = "/user.UserService/GetProfile"
|
||||
UserService_RegisterForCompetition_FullMethodName = "/user.UserService/RegisterForCompetition"
|
||||
UserService_UnregisterFromCompetition_FullMethodName = "/user.UserService/UnregisterFromCompetition"
|
||||
UserService_ListUserCompetitions_FullMethodName = "/user.UserService/ListUserCompetitions"
|
||||
)
|
||||
|
||||
// UserServiceClient is the client API for UserService 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 UserServiceClient interface {
|
||||
GetProfile(ctx context.Context, in *GetProfileRequest, opts ...grpc.CallOption) (*User, error)
|
||||
RegisterForCompetition(ctx context.Context, in *RegisterForCompetitionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
UnregisterFromCompetition(ctx context.Context, in *UnregisterFromCompetitionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
ListUserCompetitions(ctx context.Context, in *ListUserCompetitionsRequest, opts ...grpc.CallOption) (*ListUserCompetitionsResponse, error)
|
||||
}
|
||||
|
||||
type userServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient {
|
||||
return &userServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *userServiceClient) GetProfile(ctx context.Context, in *GetProfileRequest, opts ...grpc.CallOption) (*User, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(User)
|
||||
err := c.cc.Invoke(ctx, UserService_GetProfile_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *userServiceClient) RegisterForCompetition(ctx context.Context, in *RegisterForCompetitionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, UserService_RegisterForCompetition_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *userServiceClient) UnregisterFromCompetition(ctx context.Context, in *UnregisterFromCompetitionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, UserService_UnregisterFromCompetition_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *userServiceClient) ListUserCompetitions(ctx context.Context, in *ListUserCompetitionsRequest, opts ...grpc.CallOption) (*ListUserCompetitionsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListUserCompetitionsResponse)
|
||||
err := c.cc.Invoke(ctx, UserService_ListUserCompetitions_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// UserServiceServer is the server API for UserService service.
|
||||
// All implementations must embed UnimplementedUserServiceServer
|
||||
// for forward compatibility.
|
||||
type UserServiceServer interface {
|
||||
GetProfile(context.Context, *GetProfileRequest) (*User, error)
|
||||
RegisterForCompetition(context.Context, *RegisterForCompetitionRequest) (*emptypb.Empty, error)
|
||||
UnregisterFromCompetition(context.Context, *UnregisterFromCompetitionRequest) (*emptypb.Empty, error)
|
||||
ListUserCompetitions(context.Context, *ListUserCompetitionsRequest) (*ListUserCompetitionsResponse, error)
|
||||
mustEmbedUnimplementedUserServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedUserServiceServer 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 UnimplementedUserServiceServer struct{}
|
||||
|
||||
func (UnimplementedUserServiceServer) GetProfile(context.Context, *GetProfileRequest) (*User, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetProfile not implemented")
|
||||
}
|
||||
func (UnimplementedUserServiceServer) RegisterForCompetition(context.Context, *RegisterForCompetitionRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RegisterForCompetition not implemented")
|
||||
}
|
||||
func (UnimplementedUserServiceServer) UnregisterFromCompetition(context.Context, *UnregisterFromCompetitionRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UnregisterFromCompetition not implemented")
|
||||
}
|
||||
func (UnimplementedUserServiceServer) ListUserCompetitions(context.Context, *ListUserCompetitionsRequest) (*ListUserCompetitionsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListUserCompetitions not implemented")
|
||||
}
|
||||
func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {}
|
||||
func (UnimplementedUserServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to UserServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeUserServiceServer interface {
|
||||
mustEmbedUnimplementedUserServiceServer()
|
||||
}
|
||||
|
||||
func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedUserServiceServer 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(&UserService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _UserService_GetProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetProfileRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UserServiceServer).GetProfile(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: UserService_GetProfile_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UserServiceServer).GetProfile(ctx, req.(*GetProfileRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _UserService_RegisterForCompetition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RegisterForCompetitionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UserServiceServer).RegisterForCompetition(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: UserService_RegisterForCompetition_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UserServiceServer).RegisterForCompetition(ctx, req.(*RegisterForCompetitionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _UserService_UnregisterFromCompetition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UnregisterFromCompetitionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UserServiceServer).UnregisterFromCompetition(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: UserService_UnregisterFromCompetition_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UserServiceServer).UnregisterFromCompetition(ctx, req.(*UnregisterFromCompetitionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _UserService_ListUserCompetitions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListUserCompetitionsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UserServiceServer).ListUserCompetitions(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: UserService_ListUserCompetitions_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UserServiceServer).ListUserCompetitions(ctx, req.(*ListUserCompetitionsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var UserService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "user.UserService",
|
||||
HandlerType: (*UserServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetProfile",
|
||||
Handler: _UserService_GetProfile_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RegisterForCompetition",
|
||||
Handler: _UserService_RegisterForCompetition_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UnregisterFromCompetition",
|
||||
Handler: _UserService_UnregisterFromCompetition_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListUserCompetitions",
|
||||
Handler: _UserService_ListUserCompetitions_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "api/proto/user.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user