Documentation ¶
Overview ¶
Package echoserver is a generated protocol buffer package.
It is generated from these files:
echoserver.proto
It has these top-level messages:
EchoRequest EchoResponse Heartbeat Empty
Package echoserver is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterEchoServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterEchoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterEchoServiceServer(s *grpc.Server, srv EchoServiceServer)
- type EchoRequest
- type EchoResponse
- type EchoServiceClient
- type EchoServiceServer
- type EchoService_EchoClient
- type EchoService_EchoServer
- type EchoService_HeartbeatsClient
- type EchoService_HeartbeatsServer
- type EchoService_StreamClient
- type EchoService_StreamServer
- type Empty
- type Heartbeat
- type Heartbeat_Status
Constants ¶
This section is empty.
Variables ¶
View Source
var Heartbeat_Status_name = map[int32]string{
0: "UNKNOWN",
1: "OK",
}
View Source
var Heartbeat_Status_value = map[string]int32{
"UNKNOWN": 0,
"OK": 1,
}
Functions ¶
func RegisterEchoServiceHandler ¶
func RegisterEchoServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterEchoServiceHandler registers the http handlers for service EchoService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterEchoServiceHandlerFromEndpoint ¶
func RegisterEchoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterEchoServiceHandlerFromEndpoint is same as RegisterEchoServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterEchoServiceServer ¶
func RegisterEchoServiceServer(s *grpc.Server, srv EchoServiceServer)
Types ¶
type EchoRequest ¶
type EchoRequest struct {
Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
}
func (*EchoRequest) Descriptor ¶
func (*EchoRequest) Descriptor() ([]byte, []int)
func (*EchoRequest) GetMessage ¶
func (m *EchoRequest) GetMessage() string
func (*EchoRequest) ProtoMessage ¶
func (*EchoRequest) ProtoMessage()
func (*EchoRequest) Reset ¶
func (m *EchoRequest) Reset()
func (*EchoRequest) String ¶
func (m *EchoRequest) String() string
type EchoResponse ¶
type EchoResponse struct {
Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
}
func (*EchoResponse) Descriptor ¶
func (*EchoResponse) Descriptor() ([]byte, []int)
func (*EchoResponse) GetMessage ¶
func (m *EchoResponse) GetMessage() string
func (*EchoResponse) ProtoMessage ¶
func (*EchoResponse) ProtoMessage()
func (*EchoResponse) Reset ¶
func (m *EchoResponse) Reset()
func (*EchoResponse) String ¶
func (m *EchoResponse) String() string
type EchoServiceClient ¶
type EchoServiceClient interface { Echo(ctx context.Context, opts ...grpc.CallOption) (EchoService_EchoClient, error) Stream(ctx context.Context, in *Empty, opts ...grpc.CallOption) (EchoService_StreamClient, error) Heartbeats(ctx context.Context, opts ...grpc.CallOption) (EchoService_HeartbeatsClient, error) }
func NewEchoServiceClient ¶
func NewEchoServiceClient(cc *grpc.ClientConn) EchoServiceClient
type EchoServiceServer ¶
type EchoServiceServer interface { Echo(EchoService_EchoServer) error Stream(*Empty, EchoService_StreamServer) error Heartbeats(EchoService_HeartbeatsServer) error }
type EchoService_EchoClient ¶
type EchoService_EchoClient interface { Send(*EchoRequest) error Recv() (*EchoResponse, error) grpc.ClientStream }
type EchoService_EchoServer ¶
type EchoService_EchoServer interface { Send(*EchoResponse) error Recv() (*EchoRequest, error) grpc.ServerStream }
type EchoService_StreamClient ¶
type EchoService_StreamClient interface { Recv() (*EchoResponse, error) grpc.ClientStream }
type EchoService_StreamServer ¶
type EchoService_StreamServer interface { Send(*EchoResponse) error grpc.ServerStream }
type Empty ¶
type Empty struct { }
func (*Empty) Descriptor ¶
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
type Heartbeat ¶
type Heartbeat struct {
Status Heartbeat_Status `protobuf:"varint,1,opt,name=status,enum=echoserver.Heartbeat_Status" json:"status,omitempty"`
}
func (*Heartbeat) Descriptor ¶
func (*Heartbeat) GetStatus ¶
func (m *Heartbeat) GetStatus() Heartbeat_Status
func (*Heartbeat) ProtoMessage ¶
func (*Heartbeat) ProtoMessage()
type Heartbeat_Status ¶
type Heartbeat_Status int32
const ( Heartbeat_UNKNOWN Heartbeat_Status = 0 Heartbeat_OK Heartbeat_Status = 1 )
func (Heartbeat_Status) EnumDescriptor ¶
func (Heartbeat_Status) EnumDescriptor() ([]byte, []int)
func (Heartbeat_Status) String ¶
func (x Heartbeat_Status) String() string
Click to show internal directories.
Click to hide internal directories.