Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterCodecServer(s grpc.ServiceRegistrar, srv CodecServer)
- func RegisterRulexRpcServer(s grpc.ServiceRegistrar, srv RulexRpcServer)
- type CodecClient
- type CodecRequest
- type CodecResponse
- func (*CodecResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CodecResponse) GetCode() int32
- func (x *CodecResponse) GetData() []byte
- func (x *CodecResponse) GetMessage() string
- func (*CodecResponse) ProtoMessage()
- func (x *CodecResponse) ProtoReflect() protoreflect.Message
- func (x *CodecResponse) Reset()
- func (x *CodecResponse) String() string
- type CodecServer
- type Data
- type Response
- type RulexRpcClient
- type RulexRpcServer
- type UnimplementedCodecServer
- type UnimplementedRulexRpcServer
- type UnsafeCodecServer
- type UnsafeRulexRpcServer
Constants ¶
const ( Codec_Decode_FullMethodName = "/rulexrpc.Codec/Decode" Codec_Encode_FullMethodName = "/rulexrpc.Codec/Encode" )
const (
RulexRpc_Work_FullMethodName = "/rulexrpc.RulexRpc/Work"
)
Variables ¶
var Codec_ServiceDesc = grpc.ServiceDesc{ ServiceName: "rulexrpc.Codec", HandlerType: (*CodecServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Decode", Handler: _Codec_Decode_Handler, }, { MethodName: "Encode", Handler: _Codec_Encode_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "xcodec.proto", }
Codec_ServiceDesc is the grpc.ServiceDesc for Codec service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_grpc_source_proto protoreflect.FileDescriptor
var File_xcodec_proto protoreflect.FileDescriptor
var RulexRpc_ServiceDesc = grpc.ServiceDesc{ ServiceName: "rulexrpc.RulexRpc", HandlerType: (*RulexRpcServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Work", Handler: _RulexRpc_Work_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "grpc_source.proto", }
RulexRpc_ServiceDesc is the grpc.ServiceDesc for RulexRpc service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterCodecServer ¶
func RegisterCodecServer(s grpc.ServiceRegistrar, srv CodecServer)
func RegisterRulexRpcServer ¶
func RegisterRulexRpcServer(s grpc.ServiceRegistrar, srv RulexRpcServer)
Types ¶
type CodecClient ¶
type CodecClient interface { // 编码 Decode(ctx context.Context, in *CodecRequest, opts ...grpc.CallOption) (*CodecResponse, error) // 解码 Encode(ctx context.Context, in *CodecRequest, opts ...grpc.CallOption) (*CodecResponse, error) }
CodecClient is the client API for Codec 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 NewCodecClient ¶
func NewCodecClient(cc grpc.ClientConnInterface) CodecClient
type CodecRequest ¶
type CodecRequest struct { Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*CodecRequest) Descriptor
deprecated
func (*CodecRequest) Descriptor() ([]byte, []int)
Deprecated: Use CodecRequest.ProtoReflect.Descriptor instead.
func (*CodecRequest) GetValue ¶
func (x *CodecRequest) GetValue() []byte
func (*CodecRequest) ProtoMessage ¶
func (*CodecRequest) ProtoMessage()
func (*CodecRequest) ProtoReflect ¶
func (x *CodecRequest) ProtoReflect() protoreflect.Message
func (*CodecRequest) Reset ¶
func (x *CodecRequest) Reset()
func (*CodecRequest) String ¶
func (x *CodecRequest) String() string
type CodecResponse ¶
type CodecResponse struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,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 (*CodecResponse) Descriptor
deprecated
func (*CodecResponse) Descriptor() ([]byte, []int)
Deprecated: Use CodecResponse.ProtoReflect.Descriptor instead.
func (*CodecResponse) GetCode ¶
func (x *CodecResponse) GetCode() int32
func (*CodecResponse) GetData ¶
func (x *CodecResponse) GetData() []byte
func (*CodecResponse) GetMessage ¶
func (x *CodecResponse) GetMessage() string
func (*CodecResponse) ProtoMessage ¶
func (*CodecResponse) ProtoMessage()
func (*CodecResponse) ProtoReflect ¶
func (x *CodecResponse) ProtoReflect() protoreflect.Message
func (*CodecResponse) Reset ¶
func (x *CodecResponse) Reset()
func (*CodecResponse) String ¶
func (x *CodecResponse) String() string
type CodecServer ¶
type CodecServer interface { // 编码 Decode(context.Context, *CodecRequest) (*CodecResponse, error) // 解码 Encode(context.Context, *CodecRequest) (*CodecResponse, error) // contains filtered or unexported methods }
CodecServer is the server API for Codec service. All implementations must embed UnimplementedCodecServer for forward compatibility
type Data ¶
type Data struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*Data) Descriptor
deprecated
func (*Data) ProtoMessage ¶
func (*Data) ProtoMessage()
func (*Data) ProtoReflect ¶
func (x *Data) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
func (*Response) GetMessage ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type RulexRpcClient ¶
type RulexRpcClient interface {
Work(ctx context.Context, in *Data, opts ...grpc.CallOption) (*Response, error)
}
RulexRpcClient is the client API for RulexRpc 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 NewRulexRpcClient ¶
func NewRulexRpcClient(cc grpc.ClientConnInterface) RulexRpcClient
type RulexRpcServer ¶
type RulexRpcServer interface { Work(context.Context, *Data) (*Response, error) // contains filtered or unexported methods }
RulexRpcServer is the server API for RulexRpc service. All implementations must embed UnimplementedRulexRpcServer for forward compatibility
type UnimplementedCodecServer ¶
type UnimplementedCodecServer struct { }
UnimplementedCodecServer must be embedded to have forward compatible implementations.
func (UnimplementedCodecServer) Decode ¶
func (UnimplementedCodecServer) Decode(context.Context, *CodecRequest) (*CodecResponse, error)
func (UnimplementedCodecServer) Encode ¶
func (UnimplementedCodecServer) Encode(context.Context, *CodecRequest) (*CodecResponse, error)
type UnimplementedRulexRpcServer ¶
type UnimplementedRulexRpcServer struct { }
UnimplementedRulexRpcServer must be embedded to have forward compatible implementations.
type UnsafeCodecServer ¶
type UnsafeCodecServer interface {
// contains filtered or unexported methods
}
UnsafeCodecServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CodecServer will result in compilation errors.
type UnsafeRulexRpcServer ¶
type UnsafeRulexRpcServer interface {
// contains filtered or unexported methods
}
UnsafeRulexRpcServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RulexRpcServer will result in compilation errors.