Documentation ¶
Overview ¶
Package server is a generated protocol buffer package.
Go ¶
Go defines some messages and services and is generated using protoc-gen-go.
It is generated from these files:
go.proto
It has these top-level messages:
TestRequest TestReply
Package server is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterTestServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterTestServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TestServiceClient) error
- func RegisterTestServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer)
- type TestReply
- type TestRequest
- type TestServiceClient
- type TestServiceServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTestServiceHandler ¶
func RegisterTestServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterTestServiceHandler registers the http handlers for service TestService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterTestServiceHandlerClient ¶
func RegisterTestServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TestServiceClient) error
RegisterTestServiceHandler registers the http handlers for service TestService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TestServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TestServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TestServiceClient" to call the correct interceptors.
func RegisterTestServiceHandlerFromEndpoint ¶
func RegisterTestServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterTestServiceHandlerFromEndpoint is same as RegisterTestServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterTestServiceServer ¶
func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer)
Types ¶
type TestReply ¶
type TestReply struct { // RequestTime is the time of the request. RequestTime *google_protobuf2.Timestamp `protobuf:"bytes,1,opt,name=request_time,json=requestTime" json:"request_time,omitempty"` }
func (*TestReply) Descriptor ¶
func (*TestReply) GetRequestTime ¶
func (m *TestReply) GetRequestTime() *google_protobuf2.Timestamp
func (*TestReply) ProtoMessage ¶
func (*TestReply) ProtoMessage()
type TestRequest ¶
type TestRequest struct { // Id is the Id of the request. Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` }
TestRequest is a simple message
func (*TestRequest) Descriptor ¶
func (*TestRequest) Descriptor() ([]byte, []int)
func (*TestRequest) GetId ¶
func (m *TestRequest) GetId() string
func (*TestRequest) ProtoMessage ¶
func (*TestRequest) ProtoMessage()
func (*TestRequest) Reset ¶
func (m *TestRequest) Reset()
func (*TestRequest) String ¶
func (m *TestRequest) String() string
type TestServiceClient ¶
type TestServiceClient interface { // TestMethod is a simple unary method. TestMethod(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestReply, error) // Empty is a method with no input. Empty(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (*TestReply, error) }
func NewTestServiceClient ¶
func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient