Documentation ¶
Index ¶
- Variables
- func RegisterUserGrpcServer(s *grpc.Server, srv UserGrpcServer)
- type Result
- type UnimplementedUserGrpcServer
- func (*UnimplementedUserGrpcServer) Delete(context.Context, *UserRequest) (*UserResponse, error)
- func (*UnimplementedUserGrpcServer) Get(context.Context, *UserRequest) (*UserResponse, error)
- func (*UnimplementedUserGrpcServer) Login(context.Context, *UserRequest) (*UserResponse, error)
- func (*UnimplementedUserGrpcServer) Logout(context.Context, *UserRequest) (*UserResponse, error)
- func (*UnimplementedUserGrpcServer) Register(context.Context, *UserRequest) (*UserResponse, error)
- func (*UnimplementedUserGrpcServer) Update(context.Context, *UserRequest) (*UserResponse, error)
- type UserGrpcClient
- type UserGrpcServer
- type UserRequest
- func (*UserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UserRequest) GetClientName() string
- func (x *UserRequest) GetData() []byte
- func (*UserRequest) ProtoMessage()
- func (x *UserRequest) ProtoReflect() protoreflect.Message
- func (x *UserRequest) Reset()
- func (x *UserRequest) String() string
- type UserResponse
- func (*UserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UserResponse) GetData() []byte
- func (x *UserResponse) GetMessage() string
- func (x *UserResponse) GetResult() Result
- func (*UserResponse) ProtoMessage()
- func (x *UserResponse) ProtoReflect() protoreflect.Message
- func (x *UserResponse) Reset()
- func (x *UserResponse) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Result_name = map[int32]string{ 0: "OK", 1: "FAIL", } Result_value = map[string]int32{ "OK": 0, "FAIL": 1, } )
Enum value maps for Result.
View Source
var File_user_proto protoreflect.FileDescriptor
Functions ¶
func RegisterUserGrpcServer ¶
func RegisterUserGrpcServer(s *grpc.Server, srv UserGrpcServer)
Types ¶
type Result ¶
type Result int32
func (Result) Descriptor ¶
func (Result) Descriptor() protoreflect.EnumDescriptor
func (Result) EnumDescriptor
deprecated
func (Result) Number ¶
func (x Result) Number() protoreflect.EnumNumber
func (Result) Type ¶
func (Result) Type() protoreflect.EnumType
type UnimplementedUserGrpcServer ¶
type UnimplementedUserGrpcServer struct { }
UnimplementedUserGrpcServer can be embedded to have forward compatible implementations.
func (*UnimplementedUserGrpcServer) Delete ¶
func (*UnimplementedUserGrpcServer) Delete(context.Context, *UserRequest) (*UserResponse, error)
func (*UnimplementedUserGrpcServer) Get ¶ added in v1.0.20
func (*UnimplementedUserGrpcServer) Get(context.Context, *UserRequest) (*UserResponse, error)
func (*UnimplementedUserGrpcServer) Login ¶
func (*UnimplementedUserGrpcServer) Login(context.Context, *UserRequest) (*UserResponse, error)
func (*UnimplementedUserGrpcServer) Logout ¶
func (*UnimplementedUserGrpcServer) Logout(context.Context, *UserRequest) (*UserResponse, error)
func (*UnimplementedUserGrpcServer) Register ¶
func (*UnimplementedUserGrpcServer) Register(context.Context, *UserRequest) (*UserResponse, error)
func (*UnimplementedUserGrpcServer) Update ¶
func (*UnimplementedUserGrpcServer) Update(context.Context, *UserRequest) (*UserResponse, error)
type UserGrpcClient ¶
type UserGrpcClient interface { Register(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*UserResponse, error) Login(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*UserResponse, error) Logout(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*UserResponse, error) Update(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*UserResponse, error) Delete(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*UserResponse, error) Get(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*UserResponse, error) }
UserGrpcClient is the client API for UserGrpc service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewUserGrpcClient ¶
func NewUserGrpcClient(cc grpc.ClientConnInterface) UserGrpcClient
type UserGrpcServer ¶
type UserGrpcServer interface { Register(context.Context, *UserRequest) (*UserResponse, error) Login(context.Context, *UserRequest) (*UserResponse, error) Logout(context.Context, *UserRequest) (*UserResponse, error) Update(context.Context, *UserRequest) (*UserResponse, error) Delete(context.Context, *UserRequest) (*UserResponse, error) Get(context.Context, *UserRequest) (*UserResponse, error) }
UserGrpcServer is the server API for UserGrpc service.
type UserRequest ¶ added in v1.0.10
type UserRequest struct { ClientName string `protobuf:"bytes,1,opt,name=client_name,json=clientName,proto3" json:"client_name,omitempty"` // 微服务名称 Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // json序列化数据 // contains filtered or unexported fields }
message 可理解为golang中的struct,可嵌套 message 名称首字母大写,驼峰格式 内部变量小写,下划线连接
func (*UserRequest) Descriptor
deprecated
added in
v1.0.10
func (*UserRequest) Descriptor() ([]byte, []int)
Deprecated: Use UserRequest.ProtoReflect.Descriptor instead.
func (*UserRequest) GetClientName ¶ added in v1.0.10
func (x *UserRequest) GetClientName() string
func (*UserRequest) GetData ¶ added in v1.0.10
func (x *UserRequest) GetData() []byte
func (*UserRequest) ProtoMessage ¶ added in v1.0.10
func (*UserRequest) ProtoMessage()
func (*UserRequest) ProtoReflect ¶ added in v1.0.10
func (x *UserRequest) ProtoReflect() protoreflect.Message
func (*UserRequest) Reset ¶ added in v1.0.10
func (x *UserRequest) Reset()
func (*UserRequest) String ¶ added in v1.0.10
func (x *UserRequest) String() string
type UserResponse ¶ added in v1.0.10
type UserResponse struct { Result Result `protobuf:"varint,1,opt,name=result,proto3,enum=Result" json:"result,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*UserResponse) Descriptor
deprecated
added in
v1.0.10
func (*UserResponse) Descriptor() ([]byte, []int)
Deprecated: Use UserResponse.ProtoReflect.Descriptor instead.
func (*UserResponse) GetData ¶ added in v1.0.10
func (x *UserResponse) GetData() []byte
func (*UserResponse) GetMessage ¶ added in v1.0.20
func (x *UserResponse) GetMessage() string
func (*UserResponse) GetResult ¶ added in v1.0.10
func (x *UserResponse) GetResult() Result
func (*UserResponse) ProtoMessage ¶ added in v1.0.10
func (*UserResponse) ProtoMessage()
func (*UserResponse) ProtoReflect ¶ added in v1.0.10
func (x *UserResponse) ProtoReflect() protoreflect.Message
func (*UserResponse) Reset ¶ added in v1.0.10
func (x *UserResponse) Reset()
func (*UserResponse) String ¶ added in v1.0.10
func (x *UserResponse) String() string
Click to show internal directories.
Click to hide internal directories.