Documentation ¶
Index ¶
- Variables
- func NewClientTransport(stream Transport_StreamClient, codec Codec) fine.Transport
- func NewServerStreamHandler(l log.Logger, stream Transport_StreamServer, codec Codec) (server.Handler, func(), error)
- func RegisterTransportServer(s grpc.ServiceRegistrar, srv TransportServer)
- func WithCodec(ctx context.Context, c Codec) context.Context
- type Codec
- type Request
- type Response
- type TransportClient
- type TransportServer
- type Transport_StreamClient
- type Transport_StreamServer
- type UnimplementedTransportServer
- type UnsafeTransportServer
Constants ¶
This section is empty.
Variables ¶
var File_grpcfine_proto protoreflect.FileDescriptor
var Transport_ServiceDesc = grpc.ServiceDesc{ ServiceName: "grpcfine.fine.viceroy.v1.Transport", HandlerType: (*TransportServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Stream", Handler: _Transport_Stream_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "grpcfine.proto", }
Transport_ServiceDesc is the grpc.ServiceDesc for Transport service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func NewClientTransport ¶
func NewClientTransport(stream Transport_StreamClient, codec Codec) fine.Transport
NewClientTransport returns a new fine.Transport from a gRPC Transport stream.
func NewServerStreamHandler ¶
func NewServerStreamHandler(l log.Logger, stream Transport_StreamServer, codec Codec) (server.Handler, func(), error)
NewServerStreamHandler converts a Transport server stream into an server.Handler that can be used invoke commands. Call Wait to wait for the handler to close.
func RegisterTransportServer ¶
func RegisterTransportServer(s grpc.ServiceRegistrar, srv TransportServer)
Types ¶
type Codec ¶
type Codec interface { Name() string DecodeRequest(*Request) (fine.RequestHeader, fine.Request, error) DecodeResponse(*Response) (fine.ResponseHeader, fine.Response, error) EncodeRequest(*fine.RequestHeader, fine.Request) (*Request, error) EncodeResponse(*fine.ResponseHeader, fine.Response) (*Response, error) }
type Request ¶
type Request struct { Header []byte `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
Request is a serialized FINE request. The request header and request data are specified separately. Data may be empty for requests that do not have any payload.
func (*Request) Descriptor
deprecated
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { Header []byte `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
Response is a serialized FINE response. The response header and response data are specified separately. Data may be empty for resposnes that do not have any payload, or when the header indicates an error.
func (*Response) Descriptor
deprecated
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type TransportClient ¶
type TransportClient interface {
Stream(ctx context.Context, opts ...grpc.CallOption) (Transport_StreamClient, error)
}
TransportClient is the client API for Transport 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 NewTransportClient ¶
func NewTransportClient(cc grpc.ClientConnInterface) TransportClient
type TransportServer ¶
type TransportServer interface { Stream(Transport_StreamServer) error // contains filtered or unexported methods }
TransportServer is the server API for Transport service. All implementations must embed UnimplementedTransportServer for forward compatibility
type Transport_StreamClient ¶
type Transport_StreamServer ¶
type UnimplementedTransportServer ¶
type UnimplementedTransportServer struct { }
UnimplementedTransportServer must be embedded to have forward compatible implementations.
func (UnimplementedTransportServer) Stream ¶
func (UnimplementedTransportServer) Stream(Transport_StreamServer) error
type UnsafeTransportServer ¶
type UnsafeTransportServer interface {
// contains filtered or unexported methods
}
UnsafeTransportServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TransportServer will result in compilation errors.