diff --git a/server/api.pub.tournaments.go b/server/api.pub.tournaments.go index 3f90d8970..5ae16f820 100644 --- a/server/api.pub.tournaments.go +++ b/server/api.pub.tournaments.go @@ -7,7 +7,7 @@ import ( "pathwar.land/entity" ) -func (s *svc) Tournaments(ctx context.Context, _ *Void) (*TournamentsOutput, error) { +func (s *svc) tournaments(ctx context.Context, _ *Void) ([]*UserSessionOutput_Tournament, error) { var tournaments []*entity.Tournament var memberships []*entity.TournamentMember @@ -33,12 +33,10 @@ func (s *svc) Tournaments(ctx context.Context, _ *Void) (*TournamentsOutput, err return nil, err } - output := &TournamentsOutput{ - Items: []*TournamentsOutput_Tournament{}, - } + output := []*UserSessionOutput_Tournament{} for _, tournament := range tournaments { - item := &TournamentsOutput_Tournament{ + item := &UserSessionOutput_Tournament{ Tournament: tournament, } @@ -49,7 +47,7 @@ func (s *svc) Tournaments(ctx context.Context, _ *Void) (*TournamentsOutput, err } } - output.Items = append(output.Items, item) + output = append(output, item) } return output, nil diff --git a/server/api.pub.user-session.go b/server/api.pub.user-session.go index e42964e2c..d79615b22 100644 --- a/server/api.pub.user-session.go +++ b/server/api.pub.user-session.go @@ -47,6 +47,11 @@ func (s *svc) UserSession(ctx context.Context, _ *Void) (*UserSessionOutput, err // FIXME: output.Notifications = COUNT output.Notifications = 42 + output.Tournaments, err = s.tournaments(ctx, &Void{}) + if err != nil { + return nil, err + } + return output, nil } diff --git a/server/server.pb.go b/server/server.pb.go index 15b00df65..9f3bfecd0 100644 --- a/server/server.pb.go +++ b/server/server.pb.go @@ -69,10 +69,11 @@ func (m *Void) XXX_DiscardUnknown() { var xxx_messageInfo_Void proto.InternalMessageInfo type UserSessionOutput struct { - User *entity.User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` - IsNewUser bool `protobuf:"varint,99,opt,name=is_new_user,json=isNewUser,proto3" json:"is_new_user,omitempty"` - Claims *client.Claims `protobuf:"bytes,100,opt,name=claims,proto3" json:"claims,omitempty"` - Notifications int32 `protobuf:"varint,200,opt,name=notifications,proto3" json:"notifications,omitempty"` + User *entity.User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + IsNewUser bool `protobuf:"varint,2,opt,name=is_new_user,json=isNewUser,proto3" json:"is_new_user,omitempty"` + Claims *client.Claims `protobuf:"bytes,3,opt,name=claims,proto3" json:"claims,omitempty"` + Notifications int32 `protobuf:"varint,4,opt,name=notifications,proto3" json:"notifications,omitempty"` + Tournaments []*UserSessionOutput_Tournament `protobuf:"bytes,5,rep,name=tournaments,proto3" json:"tournaments,omitempty"` } func (m *UserSessionOutput) Reset() { *m = UserSessionOutput{} } @@ -136,67 +137,30 @@ func (m *UserSessionOutput) GetNotifications() int32 { return 0 } -type TournamentsOutput struct { - Items []*TournamentsOutput_Tournament `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` -} - -func (m *TournamentsOutput) Reset() { *m = TournamentsOutput{} } -func (m *TournamentsOutput) String() string { return proto.CompactTextString(m) } -func (*TournamentsOutput) ProtoMessage() {} -func (*TournamentsOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_fde5b5d7aefe7c04, []int{2} -} -func (m *TournamentsOutput) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TournamentsOutput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TournamentsOutput.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TournamentsOutput) XXX_Merge(src proto.Message) { - xxx_messageInfo_TournamentsOutput.Merge(m, src) -} -func (m *TournamentsOutput) XXX_Size() int { - return m.Size() -} -func (m *TournamentsOutput) XXX_DiscardUnknown() { - xxx_messageInfo_TournamentsOutput.DiscardUnknown(m) -} - -var xxx_messageInfo_TournamentsOutput proto.InternalMessageInfo - -func (m *TournamentsOutput) GetItems() []*TournamentsOutput_Tournament { +func (m *UserSessionOutput) GetTournaments() []*UserSessionOutput_Tournament { if m != nil { - return m.Items + return m.Tournaments } return nil } -type TournamentsOutput_Tournament struct { +type UserSessionOutput_Tournament struct { Tournament *entity.Tournament `protobuf:"bytes,1,opt,name=tournament,proto3" json:"tournament,omitempty"` Team *entity.TournamentTeam `protobuf:"bytes,2,opt,name=team,proto3" json:"team,omitempty"` } -func (m *TournamentsOutput_Tournament) Reset() { *m = TournamentsOutput_Tournament{} } -func (m *TournamentsOutput_Tournament) String() string { return proto.CompactTextString(m) } -func (*TournamentsOutput_Tournament) ProtoMessage() {} -func (*TournamentsOutput_Tournament) Descriptor() ([]byte, []int) { - return fileDescriptor_fde5b5d7aefe7c04, []int{2, 0} +func (m *UserSessionOutput_Tournament) Reset() { *m = UserSessionOutput_Tournament{} } +func (m *UserSessionOutput_Tournament) String() string { return proto.CompactTextString(m) } +func (*UserSessionOutput_Tournament) ProtoMessage() {} +func (*UserSessionOutput_Tournament) Descriptor() ([]byte, []int) { + return fileDescriptor_fde5b5d7aefe7c04, []int{1, 0} } -func (m *TournamentsOutput_Tournament) XXX_Unmarshal(b []byte) error { +func (m *UserSessionOutput_Tournament) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TournamentsOutput_Tournament) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *UserSessionOutput_Tournament) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TournamentsOutput_Tournament.Marshal(b, m, deterministic) + return xxx_messageInfo_UserSessionOutput_Tournament.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -206,26 +170,26 @@ func (m *TournamentsOutput_Tournament) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *TournamentsOutput_Tournament) XXX_Merge(src proto.Message) { - xxx_messageInfo_TournamentsOutput_Tournament.Merge(m, src) +func (m *UserSessionOutput_Tournament) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserSessionOutput_Tournament.Merge(m, src) } -func (m *TournamentsOutput_Tournament) XXX_Size() int { +func (m *UserSessionOutput_Tournament) XXX_Size() int { return m.Size() } -func (m *TournamentsOutput_Tournament) XXX_DiscardUnknown() { - xxx_messageInfo_TournamentsOutput_Tournament.DiscardUnknown(m) +func (m *UserSessionOutput_Tournament) XXX_DiscardUnknown() { + xxx_messageInfo_UserSessionOutput_Tournament.DiscardUnknown(m) } -var xxx_messageInfo_TournamentsOutput_Tournament proto.InternalMessageInfo +var xxx_messageInfo_UserSessionOutput_Tournament proto.InternalMessageInfo -func (m *TournamentsOutput_Tournament) GetTournament() *entity.Tournament { +func (m *UserSessionOutput_Tournament) GetTournament() *entity.Tournament { if m != nil { return m.Tournament } return nil } -func (m *TournamentsOutput_Tournament) GetTeam() *entity.TournamentTeam { +func (m *UserSessionOutput_Tournament) GetTeam() *entity.TournamentTeam { if m != nil { return m.Team } @@ -235,72 +199,69 @@ func (m *TournamentsOutput_Tournament) GetTeam() *entity.TournamentTeam { func init() { proto.RegisterType((*Void)(nil), "pathwar.server.Void") proto.RegisterType((*UserSessionOutput)(nil), "pathwar.server.UserSessionOutput") - proto.RegisterType((*TournamentsOutput)(nil), "pathwar.server.TournamentsOutput") - proto.RegisterType((*TournamentsOutput_Tournament)(nil), "pathwar.server.TournamentsOutput.Tournament") + proto.RegisterType((*UserSessionOutput_Tournament)(nil), "pathwar.server.UserSessionOutput.Tournament") } func init() { proto.RegisterFile("server/server.proto", fileDescriptor_fde5b5d7aefe7c04) } var fileDescriptor_fde5b5d7aefe7c04 = []byte{ - // 925 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x95, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0xc7, 0xb3, 0xce, 0xc6, 0x49, 0xc6, 0x75, 0xdc, 0x4c, 0x42, 0x71, 0x2d, 0x70, 0x97, 0x95, - 0x90, 0xa2, 0xa8, 0xbb, 0x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 0x43, 0x39, 0x03, 0xfa, 0x04, 0x9c, - 0x7e, 0x02, 0x6b, 0x23, 0xf3, 0x20, 0x0e, 0xc2, 0xeb, 0xe6, 0x98, 0x68, 0x27, 0x33, 0x67, 0x97, - 0x35, 0x54, 0x7e, 0x3d, 0x72, 0xfa, 0x71, 0x10, 0xee, 0xff, 0x66, 0x3e, 0x6d, 0xfe, 0xbb, 0x88, - 0x7f, 0x35, 0x50, 0xa9, 0x93, 0xba, 0xac, 0x66, 0xa7, 0x6d, 0x1f, 0xa2, 0x1b, 0x93, 0x6d, 0x52, - 0x72, 0x6c, 0x0f, 0x95, 0x0a, 0xe5, 0x1e, 0x21, 0xb9, 0x17, 0x6f, 0x76, 0xca, 0x64, 0xad, 0xad, - 0x4b, 0x45, 0x07, 0x83, 0x0f, 0x26, 0x87, 0x73, 0x50, 0xdb, 0x07, 0x08, 0x35, 0x43, 0xea, 0x0d, - 0xc1, 0x69, 0xb8, 0x3b, 0xf8, 0xdd, 0x57, 0x43, 0x48, 0x6f, 0x24, 0x7a, 0x24, 0xa0, 0x52, 0x41, - 0x44, 0x8e, 0xda, 0xf7, 0x0f, 0x1f, 0x1e, 0x1f, 0x36, 0x16, 0xdf, 0x71, 0x77, 0x6a, 0x15, 0x1a, - 0x32, 0x37, 0xc7, 0xb6, 0x0d, 0xb2, 0x5d, 0x28, 0x98, 0x8d, 0x9b, 0x34, 0x0c, 0x47, 0xd9, 0x7b, - 0x8c, 0x7c, 0x25, 0x05, 0xdf, 0x9b, 0x89, 0x74, 0x3b, 0x68, 0x71, 0x77, 0xe7, 0x1e, 0x6e, 0xa3, - 0x56, 0x17, 0x54, 0x1c, 0x71, 0xe8, 0x5b, 0xe3, 0x21, 0x70, 0x4b, 0x0d, 0xc1, 0x4a, 0x66, 0xda, - 0xea, 0x0b, 0x90, 0x16, 0x17, 0xca, 0x1a, 0xd2, 0x53, 0xb0, 0x42, 0x88, 0x02, 0xa6, 0x1f, 0x49, - 0x4b, 0x09, 0x8b, 0x7a, 0x1e, 0x48, 0xa9, 0xb5, 0x11, 0x48, 0x11, 0x47, 0x1e, 0xb8, 0xdd, 0xf7, - 0x13, 0xe2, 0x2e, 0xde, 0x45, 0xdb, 0xb3, 0xc4, 0x89, 0xea, 0x25, 0x15, 0xbe, 0x61, 0x52, 0xb9, - 0xb8, 0x88, 0xcc, 0x9f, 0x0b, 0xc6, 0xf2, 0xe3, 0x1d, 0x54, 0x41, 0xab, 0xfb, 0x54, 0x32, 0xaf, - 0x19, 0xab, 0x21, 0x2e, 0xac, 0x18, 0xe8, 0xcd, 0xa4, 0x50, 0xec, 0x01, 0x9c, 0xe9, 0x48, 0x65, - 0xa5, 0x50, 0x5b, 0xfd, 0xdc, 0x69, 0x76, 0xda, 0xce, 0x03, 0x38, 0xb3, 0x0a, 0xbd, 0x3b, 0xa8, - 0x9c, 0x77, 0x2c, 0xa0, 0xb5, 0x4b, 0xfa, 0x85, 0xe8, 0x3d, 0x84, 0x3f, 0x16, 0x11, 0x58, 0xb4, - 0x27, 0x62, 0x65, 0x65, 0xad, 0xbb, 0x4e, 0xd7, 0x9e, 0x9d, 0xd7, 0x8d, 0xe7, 0xe7, 0x75, 0xe3, - 0xef, 0xf3, 0xba, 0xf1, 0xe3, 0x45, 0x7d, 0xe1, 0xf9, 0x45, 0x7d, 0xe1, 0xaf, 0x8b, 0xfa, 0xc2, - 0xe3, 0x8d, 0x49, 0xad, 0x47, 0x94, 0xf7, 0xb3, 0x6f, 0x75, 0xaf, 0xa8, 0xbf, 0x7b, 0xf7, 0xfe, - 0x0b, 0x00, 0x00, 0xff, 0xff, 0xcf, 0x7b, 0xd6, 0x40, 0xc3, 0x07, 0x00, 0x00, + // 896 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x95, 0x4f, 0x6f, 0xe3, 0x44, + 0x18, 0xc6, 0xe3, 0xc4, 0x49, 0x9b, 0x09, 0x69, 0x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 0xd9, + 0x2a, 0x34, 0x4d, 0x9c, 0xfd, 0xf6, 0x7b, 0xfb, 0x87, 0x1c, 0x5a, 0xff, 0x4c, 0x42, 0x78, 0x08, + 0x52, 0x32, 0xc1, 0x3f, 0x8d, 0x54, 0x10, 0x29, 0xdc, 0x40, 0x66, 0x24, 0x21, 0xac, 0x1a, 0x96, + 0xd1, 0x28, 0x35, 0xef, 0xba, 0xb3, 0x62, 0xd3, 0x23, 0x62, 0x43, 0x4f, 0x2b, 0x70, 0x1d, 0x95, + 0x98, 0x3c, 0xe2, 0x30, 0x3d, 0xd2, 0x86, 0xac, 0x65, 0x34, 0x56, 0x7b, 0x45, 0x26, 0x0f, 0x60, + 0x1a, 0xab, 0xb0, 0x8b, 0x0a, 0xde, 0x98, 0xb2, 0x89, 0xac, 0xe6, 0x34, 0xeb, 0xde, 0x39, 0x2b, + 0xcd, 0xec, 0x89, 0xde, 0xed, 0xa5, 0x2a, 0xfc, 0x0e, 0x2a, 0x73, 0xa1, 0xd8, 0x90, 0x79, 0x49, + 0x8d, 0x55, 0xd3, 0x32, 0x1a, 0xf9, 0xde, 0xe5, 0x20, 0x3e, 0x40, 0x25, 0x25, 0xa2, 0x90, 0xd3, + 0x09, 0x70, 0x25, 0xab, 0x79, 0x2b, 0xd7, 0x28, 0x35, 0x1f, 0xba, 0x97, 0x67, 0xe2, 0x5e, 0xa9, + 0xcb, 0x7d, 0x76, 0x6e, 0xea, 0xcd, 0x03, 0x6a, 0xdf, 0x21, 0x74, 0xb1, 0x85, 0x77, 0x10, 0xba, + 0xd8, 0x4c, 0x7b, 0x50, 0x5b, 0xec, 0xc1, 0x1c, 0x6a, 0x4e, 0x8d, 0x9b, 0xc8, 0x54, 0x40, 0x27, + 0xba, 0x11, 0xa5, 0x66, 0x7d, 0xb9, 0xeb, 0x19, 0xd0, 0x49, 0x4f, 0x6b, 0x9b, 0xbf, 0xe7, 0x51, + 0xe1, 0x50, 0xa7, 0x8c, 0x5b, 0xc8, 0xec, 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4, 0xc4, 0x6d, 0xbc, 0x8d, 0x36, 0xaf, 0x12, 0x67, 0xaa, 0x0b, 0x2a, 0x7c, + 0xc3, 0xa4, 0x72, 0x71, 0x01, 0x99, 0xbf, 0x64, 0x8d, 0x95, 0xe7, 0x5b, 0xa8, 0x82, 0x8a, 0x8f, + 0xa9, 0x64, 0x5e, 0x2b, 0x52, 0x23, 0x9c, 0x5d, 0x35, 0xd0, 0x5b, 0x71, 0xa3, 0xd8, 0x53, 0x38, + 0xd1, 0x91, 0xca, 0x6a, 0xb6, 0x56, 0xfc, 0xc2, 0x69, 0x75, 0x3b, 0xce, 0x53, 0x38, 0xb1, 0xb2, + 0xfd, 0x07, 0xa8, 0x3c, 0xef, 0xc8, 0xa0, 0xb5, 0x4b, 0xfa, 0x4c, 0xf8, 0x3e, 0xc2, 0x9f, 0x88, + 0x10, 0x2c, 0xda, 0x17, 0x91, 0xb2, 0xd2, 0xd1, 0xdd, 0x66, 0x6a, 0x7f, 0x9c, 0xd6, 0x8d, 0x57, + 0xa7, 0x75, 0xe3, 0xef, 0xd3, 0xba, 0xf1, 0xd3, 0x59, 0x3d, 0xf3, 0xea, 0xac, 0x9e, 0xf9, 0xeb, + 0xac, 0x9e, 0x79, 0xbe, 0x31, 0xeb, 0xf5, 0x98, 0xf2, 0x41, 0xfa, 0x09, 0xed, 0x17, 0xf4, 0xe7, + 0xe8, 0xd1, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x5d, 0x58, 0xba, 0x5a, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -319,8 +280,6 @@ type ServerClient interface { Ping(ctx context.Context, in *Void, opts ...grpc.CallOption) (*Void, error) // Get current user session, based on JWT token UserSession(ctx context.Context, in *Void, opts ...grpc.CallOption) (*UserSessionOutput, error) - // List tournaments - Tournaments(ctx context.Context, in *Void, opts ...grpc.CallOption) (*TournamentsOutput, error) // List users Users(ctx context.Context, in *Void, opts ...grpc.CallOption) (*entity.UserList, error) // List levels @@ -359,15 +318,6 @@ func (c *serverClient) UserSession(ctx context.Context, in *Void, opts ...grpc.C return out, nil } -func (c *serverClient) Tournaments(ctx context.Context, in *Void, opts ...grpc.CallOption) (*TournamentsOutput, error) { - out := new(TournamentsOutput) - err := c.cc.Invoke(ctx, "/pathwar.server.Server/Tournaments", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *serverClient) Users(ctx context.Context, in *Void, opts ...grpc.CallOption) (*entity.UserList, error) { out := new(entity.UserList) err := c.cc.Invoke(ctx, "/pathwar.server.Server/Users", in, out, opts...) @@ -437,8 +387,6 @@ type ServerServer interface { Ping(context.Context, *Void) (*Void, error) // Get current user session, based on JWT token UserSession(context.Context, *Void) (*UserSessionOutput, error) - // List tournaments - Tournaments(context.Context, *Void) (*TournamentsOutput, error) // List users Users(context.Context, *Void) (*entity.UserList, error) // List levels @@ -461,9 +409,6 @@ func (*UnimplementedServerServer) Ping(ctx context.Context, req *Void) (*Void, e func (*UnimplementedServerServer) UserSession(ctx context.Context, req *Void) (*UserSessionOutput, error) { return nil, status.Errorf(codes.Unimplemented, "method UserSession not implemented") } -func (*UnimplementedServerServer) Tournaments(ctx context.Context, req *Void) (*TournamentsOutput, error) { - return nil, status.Errorf(codes.Unimplemented, "method Tournaments not implemented") -} func (*UnimplementedServerServer) Users(ctx context.Context, req *Void) (*entity.UserList, error) { return nil, status.Errorf(codes.Unimplemented, "method Users not implemented") } @@ -526,24 +471,6 @@ func _Server_UserSession_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } -func _Server_Tournaments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Void) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServerServer).Tournaments(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pathwar.server.Server/Tournaments", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServerServer).Tournaments(ctx, req.(*Void)) - } - return interceptor(ctx, in, info, handler) -} - func _Server_Users_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(Void) if err := dec(in); err != nil { @@ -682,10 +609,6 @@ var _Server_serviceDesc = grpc.ServiceDesc{ MethodName: "UserSession", Handler: _Server_UserSession_Handler, }, - { - MethodName: "Tournaments", - Handler: _Server_Tournaments_Handler, - }, { MethodName: "Users", Handler: _Server_Users_Handler, @@ -762,12 +685,24 @@ func (m *UserSessionOutput) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Tournaments) > 0 { + for iNdEx := len(m.Tournaments) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tournaments[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintServer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } if m.Notifications != 0 { i = encodeVarintServer(dAtA, i, uint64(m.Notifications)) i-- - dAtA[i] = 0xc - i-- - dAtA[i] = 0xc0 + dAtA[i] = 0x20 } if m.Claims != nil { { @@ -779,9 +714,7 @@ func (m *UserSessionOutput) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintServer(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x6 - i-- - dAtA[i] = 0xa2 + dAtA[i] = 0x1a } if m.IsNewUser { i-- @@ -791,9 +724,7 @@ func (m *UserSessionOutput) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x6 - i-- - dAtA[i] = 0x98 + dAtA[i] = 0x10 } if m.User != nil { { @@ -810,7 +741,7 @@ func (m *UserSessionOutput) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *TournamentsOutput) Marshal() (dAtA []byte, err error) { +func (m *UserSessionOutput_Tournament) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -820,49 +751,12 @@ func (m *TournamentsOutput) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TournamentsOutput) MarshalTo(dAtA []byte) (int, error) { +func (m *UserSessionOutput_Tournament) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TournamentsOutput) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintServer(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *TournamentsOutput_Tournament) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TournamentsOutput_Tournament) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TournamentsOutput_Tournament) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *UserSessionOutput_Tournament) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -925,26 +819,17 @@ func (m *UserSessionOutput) Size() (n int) { n += 1 + l + sovServer(uint64(l)) } if m.IsNewUser { - n += 3 + n += 2 } if m.Claims != nil { l = m.Claims.Size() - n += 2 + l + sovServer(uint64(l)) + n += 1 + l + sovServer(uint64(l)) } if m.Notifications != 0 { - n += 2 + sovServer(uint64(m.Notifications)) + n += 1 + sovServer(uint64(m.Notifications)) } - return n -} - -func (m *TournamentsOutput) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Items) > 0 { - for _, e := range m.Items { + if len(m.Tournaments) > 0 { + for _, e := range m.Tournaments { l = e.Size() n += 1 + l + sovServer(uint64(l)) } @@ -952,7 +837,7 @@ func (m *TournamentsOutput) Size() (n int) { return n } -func (m *TournamentsOutput_Tournament) Size() (n int) { +func (m *UserSessionOutput_Tournament) Size() (n int) { if m == nil { return 0 } @@ -1093,7 +978,7 @@ func (m *UserSessionOutput) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 99: + case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field IsNewUser", wireType) } @@ -1113,7 +998,7 @@ func (m *UserSessionOutput) Unmarshal(dAtA []byte) error { } } m.IsNewUser = bool(v != 0) - case 100: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Claims", wireType) } @@ -1149,7 +1034,7 @@ func (m *UserSessionOutput) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 200: + case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Notifications", wireType) } @@ -1168,62 +1053,9 @@ func (m *UserSessionOutput) Unmarshal(dAtA []byte) error { break } } - default: - iNdEx = preIndex - skippy, err := skipServer(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthServer - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthServer - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TournamentsOutput) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowServer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TournamentsOutput: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TournamentsOutput: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Tournaments", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1250,8 +1082,8 @@ func (m *TournamentsOutput) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, &TournamentsOutput_Tournament{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Tournaments = append(m.Tournaments, &UserSessionOutput_Tournament{}) + if err := m.Tournaments[len(m.Tournaments)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1279,7 +1111,7 @@ func (m *TournamentsOutput) Unmarshal(dAtA []byte) error { } return nil } -func (m *TournamentsOutput_Tournament) Unmarshal(dAtA []byte) error { +func (m *UserSessionOutput_Tournament) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { diff --git a/server/server.pb.gw.go b/server/server.pb.gw.go index 62d33af39..13034a12b 100644 --- a/server/server.pb.gw.go +++ b/server/server.pb.gw.go @@ -64,24 +64,6 @@ func local_request_Server_UserSession_0(ctx context.Context, marshaler runtime.M } -func request_Server_Tournaments_0(ctx context.Context, marshaler runtime.Marshaler, client ServerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Void - var metadata runtime.ServerMetadata - - msg, err := client.Tournaments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Server_Tournaments_0(ctx context.Context, marshaler runtime.Marshaler, server ServerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Void - var metadata runtime.ServerMetadata - - msg, err := server.Tournaments(ctx, &protoReq) - return msg, metadata, err - -} - func request_Server_Users_0(ctx context.Context, marshaler runtime.Marshaler, client ServerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq Void var metadata runtime.ServerMetadata @@ -253,26 +235,6 @@ func RegisterServerHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser }) - mux.Handle("GET", pattern_Server_Tournaments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Server_Tournaments_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Server_Tournaments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Server_Users_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -494,26 +456,6 @@ func RegisterServerHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli }) - mux.Handle("GET", pattern_Server_Tournaments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Server_Tournaments_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Server_Tournaments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Server_Users_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -662,8 +604,6 @@ var ( pattern_Server_UserSession_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"user-session"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Server_Tournaments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"tournaments"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Server_Users_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"users"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Server_Levels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"levels"}, "", runtime.AssumeColonVerbOpt(true))) @@ -684,8 +624,6 @@ var ( forward_Server_UserSession_0 = runtime.ForwardResponseMessage - forward_Server_Tournaments_0 = runtime.ForwardResponseMessage - forward_Server_Users_0 = runtime.ForwardResponseMessage forward_Server_Levels_0 = runtime.ForwardResponseMessage diff --git a/server/server.proto b/server/server.proto index 2af659b1a..a84bf855e 100644 --- a/server/server.proto +++ b/server/server.proto @@ -100,13 +100,6 @@ service Server { option (google.api.http) = {get: "/user-session"}; }; - // List tournaments - rpc Tournaments(Void) returns (TournamentsOutput) { - // FIXME: should be available for unauthenticated AND authenticated people - option (google.api.http) = {get: "/tournaments"}; - // FIXME: pagination & filters - }; - // List users rpc Users(Void) returns (pathwar.entity.UserList) { // FIXME: only for authenticated users @@ -156,16 +149,14 @@ message Void { } message UserSessionOutput { - entity.User user = 1; - bool is_new_user = 99; - client.Claims claims = 100; - int32 notifications = 200; -} - -message TournamentsOutput { message Tournament { entity.Tournament tournament = 1; entity.TournamentTeam team = 2; } - repeated Tournament items = 1; -} \ No newline at end of file + + entity.User user = 1; + bool is_new_user = 2; + client.Claims claims = 3; + int32 notifications = 4; + repeated Tournament tournaments = 5; +} diff --git a/swagger.yaml b/swagger.yaml index 90e120c2e..5479dbfbc 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -693,20 +693,6 @@ definitions: visibility: $ref: '#/definitions/TournamentVisibility' type: object - serverTournamentsOutput: - properties: - items: - items: - $ref: '#/definitions/serverTournamentsOutputTournament' - type: array - type: object - serverTournamentsOutputTournament: - properties: - team: - $ref: '#/definitions/entityTournamentTeam' - tournament: - $ref: '#/definitions/pathwarentityTournament' - type: object serverUserSessionOutput: properties: claims: @@ -717,9 +703,20 @@ definitions: notifications: format: int32 type: integer + tournaments: + items: + $ref: '#/definitions/serverUserSessionOutputTournament' + type: array user: $ref: '#/definitions/entityUser' type: object + serverUserSessionOutputTournament: + properties: + team: + $ref: '#/definitions/entityTournamentTeam' + tournament: + $ref: '#/definitions/pathwarentityTournament' + type: object serverVoid: example: {} title: Void is an empty message @@ -875,26 +872,6 @@ paths: summary: List teams tags: - Server - /tournaments: - get: - operationId: Tournaments - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/serverTournamentsOutput' - "403": - description: Returned when the user does not have permission to access the - resource. - schema: {} - "404": - description: Returned when the resource does not exist. - schema: - format: string - type: string - summary: List tournaments - tags: - - Server /user-session: get: operationId: UserSession