Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterXStreamServer(s grpc.ServiceRegistrar, srv XStreamServer)
- func ServerOptions() []grpc.ServerOption
- func StartXStreamClient()
- func StartXStreamServer()
- type Request
- type Response
- func (*Response) Descriptor() ([]byte, []int)deprecated
- func (x *Response) GetCode() int32
- func (x *Response) GetMessage() string
- func (x *Response) GetRequest() string
- func (*Response) ProtoMessage()
- func (x *Response) ProtoReflect() protoreflect.Message
- func (x *Response) Reset()
- func (x *Response) String() string
- type UnimplementedXStreamServer
- type UnsafeXStreamServer
- type XStreamClient
- type XStreamServer
- type XStream_OnApproachedClient
- type XStream_OnApproachedServer
- type XStream_SendStreamClient
- type XStream_SendStreamServer
Constants ¶
const ( XStream_OnApproached_FullMethodName = "/xstream.XStream/OnApproached" XStream_SendStream_FullMethodName = "/xstream.XStream/SendStream" )
Variables ¶
var File_xstream_proto protoreflect.FileDescriptor
var XStream_ServiceDesc = grpc.ServiceDesc{ ServiceName: "xstream.XStream", HandlerType: (*XStreamServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "OnApproached", Handler: _XStream_OnApproached_Handler, ClientStreams: true, }, { StreamName: "SendStream", Handler: _XStream_SendStream_Handler, ServerStreams: true, }, }, Metadata: "xstream.proto", }
XStream_ServiceDesc is the grpc.ServiceDesc for XStream service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterXStreamServer ¶
func RegisterXStreamServer(s grpc.ServiceRegistrar, srv XStreamServer)
func ServerOptions ¶
func ServerOptions() []grpc.ServerOption
func StartXStreamClient ¶
func StartXStreamClient()
func StartXStreamServer ¶
func StartXStreamServer()
Types ¶
type Request ¶
type Request struct { Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*Request) Descriptor
deprecated
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) 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"` Request string `protobuf:"bytes,3,opt,name=Request,proto3" json:"Request,omitempty"` // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
func (*Response) GetMessage ¶
func (*Response) GetRequest ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type UnimplementedXStreamServer ¶
type UnimplementedXStreamServer struct { }
UnimplementedXStreamServer must be embedded to have forward compatible implementations.
func (UnimplementedXStreamServer) OnApproached ¶
func (UnimplementedXStreamServer) OnApproached(XStream_OnApproachedServer) error
func (UnimplementedXStreamServer) SendStream ¶
func (UnimplementedXStreamServer) SendStream(*Request, XStream_SendStreamServer) error
type UnsafeXStreamServer ¶
type UnsafeXStreamServer interface {
// contains filtered or unexported methods
}
UnsafeXStreamServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to XStreamServer will result in compilation errors.
type XStreamClient ¶
type XStreamClient interface { // 收到来自其他端点的请求 OnApproached(ctx context.Context, opts ...grpc.CallOption) (XStream_OnApproachedClient, error) // 给其他端点发送请求 SendStream(ctx context.Context, in *Request, opts ...grpc.CallOption) (XStream_SendStreamClient, error) }
XStreamClient is the client API for XStream 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 NewXStreamClient ¶
func NewXStreamClient(cc grpc.ClientConnInterface) XStreamClient
type XStreamServer ¶
type XStreamServer interface { // 收到来自其他端点的请求 OnApproached(XStream_OnApproachedServer) error // 给其他端点发送请求 SendStream(*Request, XStream_SendStreamServer) error // contains filtered or unexported methods }
XStreamServer is the server API for XStream service. All implementations must embed UnimplementedXStreamServer for forward compatibility
type XStream_SendStreamClient ¶
type XStream_SendStreamClient interface { Recv() (*Response, error) grpc.ClientStream }
type XStream_SendStreamServer ¶
type XStream_SendStreamServer interface { Send(*Response) error grpc.ServerStream }