Documentation ¶
Index ¶
- Variables
- func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)
- type CreateUpdateUserRequest
- func (*CreateUpdateUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateUpdateUserRequest) GetAge() int32
- func (x *CreateUpdateUserRequest) GetGreeting() string
- func (x *CreateUpdateUserRequest) GetId() string
- func (x *CreateUpdateUserRequest) GetName() string
- func (x *CreateUpdateUserRequest) GetOperation() Operation
- func (x *CreateUpdateUserRequest) GetPower() string
- func (x *CreateUpdateUserRequest) GetSalary() int32
- func (*CreateUpdateUserRequest) ProtoMessage()
- func (x *CreateUpdateUserRequest) ProtoReflect() protoreflect.Message
- func (x *CreateUpdateUserRequest) Reset()
- func (x *CreateUpdateUserRequest) String() string
- type CreateUpdateUserResponse
- func (*CreateUpdateUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateUpdateUserResponse) GetId() string
- func (*CreateUpdateUserResponse) ProtoMessage()
- func (x *CreateUpdateUserResponse) ProtoReflect() protoreflect.Message
- func (x *CreateUpdateUserResponse) Reset()
- func (x *CreateUpdateUserResponse) String() string
- type GetUserDetailsRequest
- func (*GetUserDetailsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserDetailsRequest) GetId() string
- func (*GetUserDetailsRequest) ProtoMessage()
- func (x *GetUserDetailsRequest) ProtoReflect() protoreflect.Message
- func (x *GetUserDetailsRequest) Reset()
- func (x *GetUserDetailsRequest) String() string
- type GetUserDetailsResponse
- func (*GetUserDetailsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserDetailsResponse) GetPower() string
- func (x *GetUserDetailsResponse) GetSalary() int32
- func (*GetUserDetailsResponse) ProtoMessage()
- func (x *GetUserDetailsResponse) ProtoReflect() protoreflect.Message
- func (x *GetUserDetailsResponse) Reset()
- func (x *GetUserDetailsResponse) String() string
- type GetUserResponse
- func (*GetUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserResponse) GetAge() int32
- func (x *GetUserResponse) GetGreeting() string
- func (x *GetUserResponse) GetId() string
- func (x *GetUserResponse) GetName() string
- func (*GetUserResponse) ProtoMessage()
- func (x *GetUserResponse) ProtoReflect() protoreflect.Message
- func (x *GetUserResponse) Reset()
- func (x *GetUserResponse) String() string
- type GetUsersRequest
- type GetUsersResponse
- func (*GetUsersResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetUsersResponse) GetUsers() []*GetUserResponse
- func (*GetUsersResponse) ProtoMessage()
- func (x *GetUsersResponse) ProtoReflect() protoreflect.Message
- func (x *GetUsersResponse) Reset()
- func (x *GetUsersResponse) String() string
- type Operation
- type UnimplementedUserServiceServer
- func (UnimplementedUserServiceServer) CreateUpdateUser(context.Context, *CreateUpdateUserRequest) (*CreateUpdateUserResponse, error)
- func (UnimplementedUserServiceServer) GetUserDetails(context.Context, *GetUserDetailsRequest) (*GetUserDetailsResponse, error)
- func (UnimplementedUserServiceServer) GetUsers(context.Context, *GetUsersRequest) (*GetUsersResponse, error)
- type UnsafeUserServiceServer
- type UserServiceClient
- type UserServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( Operation_name = map[int32]string{ 0: "CREATE", 1: "UPDATE", } Operation_value = map[string]int32{ "CREATE": 0, "UPDATE": 1, } )
Enum value maps for Operation.
var File_user_proto protoreflect.FileDescriptor
var UserService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "userpb.UserService", HandlerType: (*UserServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetUserDetails", Handler: _UserService_GetUserDetails_Handler, }, { MethodName: "GetUsers", Handler: _UserService_GetUsers_Handler, }, { MethodName: "CreateUpdateUser", Handler: _UserService_CreateUpdateUser_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "user.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 CreateUpdateUserRequest ¶
type CreateUpdateUserRequest struct { Operation Operation `protobuf:"varint,1,opt,name=operation,proto3,enum=userpb.Operation" json:"operation,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` Age int32 `protobuf:"varint,4,opt,name=age,proto3" json:"age,omitempty"` Greeting string `protobuf:"bytes,5,opt,name=greeting,proto3" json:"greeting,omitempty"` Salary int32 `protobuf:"varint,6,opt,name=salary,proto3" json:"salary,omitempty"` Power string `protobuf:"bytes,7,opt,name=power,proto3" json:"power,omitempty"` // contains filtered or unexported fields }
func (*CreateUpdateUserRequest) Descriptor
deprecated
func (*CreateUpdateUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateUpdateUserRequest.ProtoReflect.Descriptor instead.
func (*CreateUpdateUserRequest) GetAge ¶
func (x *CreateUpdateUserRequest) GetAge() int32
func (*CreateUpdateUserRequest) GetGreeting ¶
func (x *CreateUpdateUserRequest) GetGreeting() string
func (*CreateUpdateUserRequest) GetId ¶
func (x *CreateUpdateUserRequest) GetId() string
func (*CreateUpdateUserRequest) GetName ¶
func (x *CreateUpdateUserRequest) GetName() string
func (*CreateUpdateUserRequest) GetOperation ¶
func (x *CreateUpdateUserRequest) GetOperation() Operation
func (*CreateUpdateUserRequest) GetPower ¶
func (x *CreateUpdateUserRequest) GetPower() string
func (*CreateUpdateUserRequest) GetSalary ¶
func (x *CreateUpdateUserRequest) GetSalary() int32
func (*CreateUpdateUserRequest) ProtoMessage ¶
func (*CreateUpdateUserRequest) ProtoMessage()
func (*CreateUpdateUserRequest) ProtoReflect ¶
func (x *CreateUpdateUserRequest) ProtoReflect() protoreflect.Message
func (*CreateUpdateUserRequest) Reset ¶
func (x *CreateUpdateUserRequest) Reset()
func (*CreateUpdateUserRequest) String ¶
func (x *CreateUpdateUserRequest) String() string
type CreateUpdateUserResponse ¶
type CreateUpdateUserResponse struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*CreateUpdateUserResponse) Descriptor
deprecated
func (*CreateUpdateUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateUpdateUserResponse.ProtoReflect.Descriptor instead.
func (*CreateUpdateUserResponse) GetId ¶
func (x *CreateUpdateUserResponse) GetId() string
func (*CreateUpdateUserResponse) ProtoMessage ¶
func (*CreateUpdateUserResponse) ProtoMessage()
func (*CreateUpdateUserResponse) ProtoReflect ¶
func (x *CreateUpdateUserResponse) ProtoReflect() protoreflect.Message
func (*CreateUpdateUserResponse) Reset ¶
func (x *CreateUpdateUserResponse) Reset()
func (*CreateUpdateUserResponse) String ¶
func (x *CreateUpdateUserResponse) String() string
type GetUserDetailsRequest ¶
type GetUserDetailsRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*GetUserDetailsRequest) Descriptor
deprecated
func (*GetUserDetailsRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetUserDetailsRequest.ProtoReflect.Descriptor instead.
func (*GetUserDetailsRequest) GetId ¶
func (x *GetUserDetailsRequest) GetId() string
func (*GetUserDetailsRequest) ProtoMessage ¶
func (*GetUserDetailsRequest) ProtoMessage()
func (*GetUserDetailsRequest) ProtoReflect ¶
func (x *GetUserDetailsRequest) ProtoReflect() protoreflect.Message
func (*GetUserDetailsRequest) Reset ¶
func (x *GetUserDetailsRequest) Reset()
func (*GetUserDetailsRequest) String ¶
func (x *GetUserDetailsRequest) String() string
type GetUserDetailsResponse ¶
type GetUserDetailsResponse struct { Salary int32 `protobuf:"varint,1,opt,name=salary,proto3" json:"salary,omitempty"` Power string `protobuf:"bytes,2,opt,name=power,proto3" json:"power,omitempty"` // contains filtered or unexported fields }
func (*GetUserDetailsResponse) Descriptor
deprecated
func (*GetUserDetailsResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetUserDetailsResponse.ProtoReflect.Descriptor instead.
func (*GetUserDetailsResponse) GetPower ¶
func (x *GetUserDetailsResponse) GetPower() string
func (*GetUserDetailsResponse) GetSalary ¶
func (x *GetUserDetailsResponse) GetSalary() int32
func (*GetUserDetailsResponse) ProtoMessage ¶
func (*GetUserDetailsResponse) ProtoMessage()
func (*GetUserDetailsResponse) ProtoReflect ¶
func (x *GetUserDetailsResponse) ProtoReflect() protoreflect.Message
func (*GetUserDetailsResponse) Reset ¶
func (x *GetUserDetailsResponse) Reset()
func (*GetUserDetailsResponse) String ¶
func (x *GetUserDetailsResponse) String() string
type GetUserResponse ¶
type GetUserResponse struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Age int32 `protobuf:"varint,3,opt,name=age,proto3" json:"age,omitempty"` Greeting string `protobuf:"bytes,4,opt,name=greeting,proto3" json:"greeting,omitempty"` // contains filtered or unexported fields }
func (*GetUserResponse) Descriptor
deprecated
func (*GetUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead.
func (*GetUserResponse) GetAge ¶
func (x *GetUserResponse) GetAge() int32
func (*GetUserResponse) GetGreeting ¶
func (x *GetUserResponse) GetGreeting() string
func (*GetUserResponse) GetId ¶
func (x *GetUserResponse) GetId() string
func (*GetUserResponse) GetName ¶
func (x *GetUserResponse) GetName() string
func (*GetUserResponse) ProtoMessage ¶
func (*GetUserResponse) ProtoMessage()
func (*GetUserResponse) ProtoReflect ¶
func (x *GetUserResponse) ProtoReflect() protoreflect.Message
func (*GetUserResponse) Reset ¶
func (x *GetUserResponse) Reset()
func (*GetUserResponse) String ¶
func (x *GetUserResponse) String() string
type GetUsersRequest ¶
type GetUsersRequest struct {
// contains filtered or unexported fields
}
func (*GetUsersRequest) Descriptor
deprecated
func (*GetUsersRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetUsersRequest.ProtoReflect.Descriptor instead.
func (*GetUsersRequest) ProtoMessage ¶
func (*GetUsersRequest) ProtoMessage()
func (*GetUsersRequest) ProtoReflect ¶
func (x *GetUsersRequest) ProtoReflect() protoreflect.Message
func (*GetUsersRequest) Reset ¶
func (x *GetUsersRequest) Reset()
func (*GetUsersRequest) String ¶
func (x *GetUsersRequest) String() string
type GetUsersResponse ¶
type GetUsersResponse struct { Users []*GetUserResponse `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` // contains filtered or unexported fields }
func (*GetUsersResponse) Descriptor
deprecated
func (*GetUsersResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetUsersResponse.ProtoReflect.Descriptor instead.
func (*GetUsersResponse) GetUsers ¶
func (x *GetUsersResponse) GetUsers() []*GetUserResponse
func (*GetUsersResponse) ProtoMessage ¶
func (*GetUsersResponse) ProtoMessage()
func (*GetUsersResponse) ProtoReflect ¶
func (x *GetUsersResponse) ProtoReflect() protoreflect.Message
func (*GetUsersResponse) Reset ¶
func (x *GetUsersResponse) Reset()
func (*GetUsersResponse) String ¶
func (x *GetUsersResponse) String() string
type Operation ¶
type Operation int32
func (Operation) Descriptor ¶
func (Operation) Descriptor() protoreflect.EnumDescriptor
func (Operation) EnumDescriptor
deprecated
func (Operation) Number ¶
func (x Operation) Number() protoreflect.EnumNumber
func (Operation) Type ¶
func (Operation) Type() protoreflect.EnumType
type UnimplementedUserServiceServer ¶
type UnimplementedUserServiceServer struct { }
UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedUserServiceServer) CreateUpdateUser ¶
func (UnimplementedUserServiceServer) CreateUpdateUser(context.Context, *CreateUpdateUserRequest) (*CreateUpdateUserResponse, error)
func (UnimplementedUserServiceServer) GetUserDetails ¶
func (UnimplementedUserServiceServer) GetUserDetails(context.Context, *GetUserDetailsRequest) (*GetUserDetailsResponse, error)
func (UnimplementedUserServiceServer) GetUsers ¶
func (UnimplementedUserServiceServer) GetUsers(context.Context, *GetUsersRequest) (*GetUsersResponse, 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 UserServiceClient ¶
type UserServiceClient interface { GetUserDetails(ctx context.Context, in *GetUserDetailsRequest, opts ...grpc.CallOption) (*GetUserDetailsResponse, error) GetUsers(ctx context.Context, in *GetUsersRequest, opts ...grpc.CallOption) (*GetUsersResponse, error) CreateUpdateUser(ctx context.Context, in *CreateUpdateUserRequest, opts ...grpc.CallOption) (*CreateUpdateUserResponse, 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 { GetUserDetails(context.Context, *GetUserDetailsRequest) (*GetUserDetailsResponse, error) GetUsers(context.Context, *GetUsersRequest) (*GetUsersResponse, error) CreateUpdateUser(context.Context, *CreateUpdateUserRequest) (*CreateUpdateUserResponse, error) // contains filtered or unexported methods }
UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility