Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)
- type AddRequest
- type AddResponse
- func (*AddResponse) Descriptor() ([]byte, []int)deprecated
- func (x *AddResponse) GetError() *rpc.Error
- func (x *AddResponse) GetResult() isAddResponse_Result
- func (x *AddResponse) GetUser() *User
- func (*AddResponse) ProtoMessage()
- func (x *AddResponse) ProtoReflect() protoreflect.Message
- func (x *AddResponse) Reset()
- func (x *AddResponse) String() string
- type AddResponse_Error
- type AddResponse_User
- type GetRequest
- type GetResponse
- func (*GetResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetResponse) GetError() *rpc.Error
- func (x *GetResponse) GetResult() isGetResponse_Result
- func (x *GetResponse) GetUser() *User
- func (*GetResponse) ProtoMessage()
- func (x *GetResponse) ProtoReflect() protoreflect.Message
- func (x *GetResponse) Reset()
- func (x *GetResponse) String() string
- type GetResponse_Error
- type GetResponse_User
- type RegistrationsResponse
- func (*RegistrationsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *RegistrationsResponse) GetUser() *User
- func (*RegistrationsResponse) ProtoMessage()
- func (x *RegistrationsResponse) ProtoReflect() protoreflect.Message
- func (x *RegistrationsResponse) Reset()
- func (x *RegistrationsResponse) String() string
- type UnimplementedUserServiceServer
- func (UnimplementedUserServiceServer) Add(context.Context, *AddRequest) (*AddResponse, error)
- func (UnimplementedUserServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error)
- func (UnimplementedUserServiceServer) Registrations(context.Context, *emptypb.Empty) (*RegistrationsResponse, error)
- type UnsafeUserServiceServer
- type User
- type UserServiceClient
- type UserServiceServer
Constants ¶
const ( UserService_Add_FullMethodName = "/example.v1.UserService/Add" UserService_Get_FullMethodName = "/example.v1.UserService/Get" UserService_Registrations_FullMethodName = "/example.v1.UserService/Registrations" )
Variables ¶
var File_example_v1_example_proto protoreflect.FileDescriptor
var UserService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "example.v1.UserService", HandlerType: (*UserServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Add", Handler: _UserService_Add_Handler, }, { MethodName: "Get", Handler: _UserService_Get_Handler, }, { MethodName: "Registrations", Handler: _UserService_Registrations_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "example/v1/example.proto", }
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)
Functions ¶
func RegisterUserServiceServer ¶
func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)
Types ¶
type AddRequest ¶
type AddRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Surname string `protobuf:"bytes,2,opt,name=surname,proto3" json:"surname,omitempty"` // contains filtered or unexported fields }
func (*AddRequest) Descriptor
deprecated
func (*AddRequest) Descriptor() ([]byte, []int)
Deprecated: Use AddRequest.ProtoReflect.Descriptor instead.
func (*AddRequest) GetName ¶
func (x *AddRequest) GetName() string
func (*AddRequest) GetSurname ¶
func (x *AddRequest) GetSurname() string
func (*AddRequest) ProtoMessage ¶
func (*AddRequest) ProtoMessage()
func (*AddRequest) ProtoReflect ¶
func (x *AddRequest) ProtoReflect() protoreflect.Message
func (*AddRequest) Reset ¶
func (x *AddRequest) Reset()
func (*AddRequest) String ¶
func (x *AddRequest) String() string
type AddResponse ¶
type AddResponse struct { // Types that are valid to be assigned to Result: // // *AddResponse_User // *AddResponse_Error Result isAddResponse_Result `protobuf_oneof:"Result"` // contains filtered or unexported fields }
func (*AddResponse) Descriptor
deprecated
func (*AddResponse) Descriptor() ([]byte, []int)
Deprecated: Use AddResponse.ProtoReflect.Descriptor instead.
func (*AddResponse) GetError ¶
func (x *AddResponse) GetError() *rpc.Error
func (*AddResponse) GetResult ¶
func (x *AddResponse) GetResult() isAddResponse_Result
func (*AddResponse) GetUser ¶
func (x *AddResponse) GetUser() *User
func (*AddResponse) ProtoMessage ¶
func (*AddResponse) ProtoMessage()
func (*AddResponse) ProtoReflect ¶
func (x *AddResponse) ProtoReflect() protoreflect.Message
func (*AddResponse) Reset ¶
func (x *AddResponse) Reset()
func (*AddResponse) String ¶
func (x *AddResponse) String() string
type AddResponse_Error ¶
type AddResponse_User ¶
type AddResponse_User struct {
User *User `protobuf:"bytes,1,opt,name=user,proto3,oneof"`
}
type GetRequest ¶
type GetRequest struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*GetRequest) Descriptor
deprecated
func (*GetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) GetId ¶
func (x *GetRequest) GetId() uint64
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) ProtoReflect ¶
func (x *GetRequest) ProtoReflect() protoreflect.Message
func (*GetRequest) Reset ¶
func (x *GetRequest) Reset()
func (*GetRequest) String ¶
func (x *GetRequest) String() string
type GetResponse ¶
type GetResponse struct { // Types that are valid to be assigned to Result: // // *GetResponse_User // *GetResponse_Error Result isGetResponse_Result `protobuf_oneof:"Result"` // contains filtered or unexported fields }
func (*GetResponse) Descriptor
deprecated
func (*GetResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.
func (*GetResponse) GetError ¶
func (x *GetResponse) GetError() *rpc.Error
func (*GetResponse) GetResult ¶
func (x *GetResponse) GetResult() isGetResponse_Result
func (*GetResponse) GetUser ¶
func (x *GetResponse) GetUser() *User
func (*GetResponse) ProtoMessage ¶
func (*GetResponse) ProtoMessage()
func (*GetResponse) ProtoReflect ¶
func (x *GetResponse) ProtoReflect() protoreflect.Message
func (*GetResponse) Reset ¶
func (x *GetResponse) Reset()
func (*GetResponse) String ¶
func (x *GetResponse) String() string
type GetResponse_Error ¶
type GetResponse_User ¶
type GetResponse_User struct {
User *User `protobuf:"bytes,1,opt,name=user,proto3,oneof"`
}
type RegistrationsResponse ¶
type RegistrationsResponse struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
func (*RegistrationsResponse) Descriptor
deprecated
func (*RegistrationsResponse) Descriptor() ([]byte, []int)
Deprecated: Use RegistrationsResponse.ProtoReflect.Descriptor instead.
func (*RegistrationsResponse) GetUser ¶
func (x *RegistrationsResponse) GetUser() *User
func (*RegistrationsResponse) ProtoMessage ¶
func (*RegistrationsResponse) ProtoMessage()
func (*RegistrationsResponse) ProtoReflect ¶
func (x *RegistrationsResponse) ProtoReflect() protoreflect.Message
func (*RegistrationsResponse) Reset ¶
func (x *RegistrationsResponse) Reset()
func (*RegistrationsResponse) String ¶
func (x *RegistrationsResponse) String() string
type UnimplementedUserServiceServer ¶
type UnimplementedUserServiceServer struct{}
UnimplementedUserServiceServer should 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.
func (UnimplementedUserServiceServer) Add ¶
func (UnimplementedUserServiceServer) Add(context.Context, *AddRequest) (*AddResponse, error)
func (UnimplementedUserServiceServer) Get ¶
func (UnimplementedUserServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error)
func (UnimplementedUserServiceServer) Registrations ¶
func (UnimplementedUserServiceServer) Registrations(context.Context, *emptypb.Empty) (*RegistrationsResponse, error)
type UnsafeUserServiceServer ¶
type UnsafeUserServiceServer interface {
// contains filtered or unexported methods
}
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 User ¶
type User struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Surname string `protobuf:"bytes,3,opt,name=surname,proto3" json:"surname,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetSurname ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserServiceClient ¶
type UserServiceClient interface { Add(ctx context.Context, in *AddRequest, opts ...grpc.CallOption) (*AddResponse, error) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) Registrations(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*RegistrationsResponse, error) }
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.
func NewUserServiceClient ¶
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient
type UserServiceServer ¶
type UserServiceServer interface { Add(context.Context, *AddRequest) (*AddResponse, error) Get(context.Context, *GetRequest) (*GetResponse, error) Registrations(context.Context, *emptypb.Empty) (*RegistrationsResponse, error) }
UserServiceServer is the server API for UserService service. All implementations should embed UnimplementedUserServiceServer for forward compatibility.