Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var File_api_protobuf_spec_grpcserverpb_v1_grpcserver_proto protoreflect.FileDescriptor
Functions ¶
func RegisterDemoServer ¶
func RegisterDemoServer(s *grpc.Server, srv DemoServer)
Types ¶
type Chunk ¶
type Chunk struct {
Data []byte `protobuf:"bytes,1,opt,name=Data,proto3" json:"Data,omitempty"`
// contains filtered or unexported fields
}
func (*Chunk) Descriptor
deprecated
func (*Chunk) ProtoMessage ¶
func (*Chunk) ProtoMessage()
func (*Chunk) ProtoReflect ¶
func (x *Chunk) ProtoReflect() protoreflect.Message
type DemoClient ¶
type DemoClient interface {
// Echo unary RPC: echoes the request message, demonstrating the
// transport -> endpoint -> middleware -> service -> store pipeline.
Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
// Download server-streaming RPC: sends data in ChunkSize chunks, demonstrating transport.StreamSendMsg.
Download(ctx context.Context, in *DownloadRequest, opts ...grpc.CallOption) (Demo_DownloadClient, error)
}
DemoClient is the client API for Demo service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewDemoClient ¶
func NewDemoClient(cc grpc.ClientConnInterface) DemoClient
type DemoServer ¶
type DemoServer interface {
// Echo unary RPC: echoes the request message, demonstrating the
// transport -> endpoint -> middleware -> service -> store pipeline.
Echo(context.Context, *EchoRequest) (*EchoResponse, error)
// Download server-streaming RPC: sends data in ChunkSize chunks, demonstrating transport.StreamSendMsg.
Download(*DownloadRequest, Demo_DownloadServer) error
}
DemoServer is the server API for Demo service.
type Demo_DownloadClient ¶
type Demo_DownloadClient interface {
Recv() (*Chunk, error)
grpc.ClientStream
}
type Demo_DownloadServer ¶
type Demo_DownloadServer interface {
Send(*Chunk) error
grpc.ServerStream
}
type DownloadRequest ¶
type DownloadRequest struct {
Key string `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"`
// contains filtered or unexported fields
}
func (*DownloadRequest) Descriptor
deprecated
func (*DownloadRequest) Descriptor() ([]byte, []int)
Deprecated: Use DownloadRequest.ProtoReflect.Descriptor instead.
func (*DownloadRequest) GetKey ¶
func (x *DownloadRequest) GetKey() string
func (*DownloadRequest) ProtoMessage ¶
func (*DownloadRequest) ProtoMessage()
func (*DownloadRequest) ProtoReflect ¶
func (x *DownloadRequest) ProtoReflect() protoreflect.Message
func (*DownloadRequest) Reset ¶
func (x *DownloadRequest) Reset()
func (*DownloadRequest) String ¶
func (x *DownloadRequest) String() string
type EchoRequest ¶
type EchoRequest struct {
Message string `protobuf:"bytes,1,opt,name=Message,proto3" json:"Message,omitempty"`
// contains filtered or unexported fields
}
func (*EchoRequest) Descriptor
deprecated
func (*EchoRequest) Descriptor() ([]byte, []int)
Deprecated: Use EchoRequest.ProtoReflect.Descriptor instead.
func (*EchoRequest) GetMessage ¶
func (x *EchoRequest) GetMessage() string
func (*EchoRequest) ProtoMessage ¶
func (*EchoRequest) ProtoMessage()
func (*EchoRequest) ProtoReflect ¶
func (x *EchoRequest) ProtoReflect() protoreflect.Message
func (*EchoRequest) Reset ¶
func (x *EchoRequest) Reset()
func (*EchoRequest) String ¶
func (x *EchoRequest) String() string
type EchoResponse ¶
type EchoResponse struct {
Message string `protobuf:"bytes,1,opt,name=Message,proto3" json:"Message,omitempty"`
// contains filtered or unexported fields
}
func (*EchoResponse) Descriptor
deprecated
func (*EchoResponse) Descriptor() ([]byte, []int)
Deprecated: Use EchoResponse.ProtoReflect.Descriptor instead.
func (*EchoResponse) GetMessage ¶
func (x *EchoResponse) GetMessage() string
func (*EchoResponse) ProtoMessage ¶
func (*EchoResponse) ProtoMessage()
func (*EchoResponse) ProtoReflect ¶
func (x *EchoResponse) ProtoReflect() protoreflect.Message
func (*EchoResponse) Reset ¶
func (x *EchoResponse) Reset()
func (*EchoResponse) String ¶
func (x *EchoResponse) String() string
type UnimplementedDemoServer ¶
type UnimplementedDemoServer struct {
}
UnimplementedDemoServer can be embedded to have forward compatible implementations.
func (*UnimplementedDemoServer) Download ¶
func (*UnimplementedDemoServer) Download(*DownloadRequest, Demo_DownloadServer) error
func (*UnimplementedDemoServer) Echo ¶
func (*UnimplementedDemoServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error)