Documentation ¶
Overview ¶
Package test is a generated protocol buffer package.
It is generated from these files:
proto/test.proto
It has these top-level messages:
SendRequest LargeRequest TestResponse EchoResponse
Package test 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 EchoResponse
- type LargeRequest
- type SendRequest
- type TestResponse
- type TestServiceClient
- type TestServiceServer
- type TestService_StreamClient
- type TestService_StreamServer
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 EchoResponse ¶
type EchoResponse struct { // Echo from service. Echo string `protobuf:"bytes,1,opt,name=echo" json:"echo,omitempty"` }
Echo response.
func (*EchoResponse) Descriptor ¶
func (*EchoResponse) Descriptor() ([]byte, []int)
func (*EchoResponse) GetEcho ¶
func (m *EchoResponse) GetEcho() string
func (*EchoResponse) ProtoMessage ¶
func (*EchoResponse) ProtoMessage()
func (*EchoResponse) Reset ¶
func (m *EchoResponse) Reset()
func (*EchoResponse) String ¶
func (m *EchoResponse) String() string
type LargeRequest ¶
type LargeRequest struct { // Length of string to return in response. Length int64 `protobuf:"varint,1,opt,name=length" json:"length,omitempty"` }
Large request.
func (*LargeRequest) Descriptor ¶
func (*LargeRequest) Descriptor() ([]byte, []int)
func (*LargeRequest) GetLength ¶
func (m *LargeRequest) GetLength() int64
func (*LargeRequest) ProtoMessage ¶
func (*LargeRequest) ProtoMessage()
func (*LargeRequest) Reset ¶
func (m *LargeRequest) Reset()
func (*LargeRequest) String ¶
func (m *LargeRequest) String() string
type SendRequest ¶
type SendRequest struct { // Value to send. Value string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` }
Send request.
func (*SendRequest) Descriptor ¶
func (*SendRequest) Descriptor() ([]byte, []int)
func (*SendRequest) GetValue ¶
func (m *SendRequest) GetValue() string
func (*SendRequest) ProtoMessage ¶
func (*SendRequest) ProtoMessage()
func (*SendRequest) Reset ¶
func (m *SendRequest) Reset()
func (*SendRequest) String ¶
func (m *SendRequest) String() string
type TestResponse ¶
type TestResponse struct { // True if operation was a success. Success bool `protobuf:"varint,1,opt,name=success" json:"success,omitempty"` }
Test response.
func (*TestResponse) Descriptor ¶
func (*TestResponse) Descriptor() ([]byte, []int)
func (*TestResponse) GetSuccess ¶
func (m *TestResponse) GetSuccess() bool
func (*TestResponse) ProtoMessage ¶
func (*TestResponse) ProtoMessage()
func (*TestResponse) Reset ¶
func (m *TestResponse) Reset()
func (*TestResponse) String ¶
func (m *TestResponse) String() string
type TestServiceClient ¶
type TestServiceClient interface { // Echo the value in the request back in the response. Echo(ctx context.Context, in *SendRequest, opts ...grpc.CallOption) (*EchoResponse, error) // Send the value in the request. Send(ctx context.Context, in *SendRequest, opts ...grpc.CallOption) (*TestResponse, error) // Large will return a large response message. Large(ctx context.Context, in *LargeRequest, opts ...grpc.CallOption) (*EchoResponse, error) // Stream a bunch of requests. Stream(ctx context.Context, opts ...grpc.CallOption) (TestService_StreamClient, error) }
func NewTestServiceClient ¶
func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient
type TestServiceServer ¶
type TestServiceServer interface { // Echo the value in the request back in the response. Echo(context.Context, *SendRequest) (*EchoResponse, error) // Send the value in the request. Send(context.Context, *SendRequest) (*TestResponse, error) // Large will return a large response message. Large(context.Context, *LargeRequest) (*EchoResponse, error) // Stream a bunch of requests. Stream(TestService_StreamServer) error }
type TestService_StreamClient ¶
type TestService_StreamClient interface { Send(*SendRequest) error CloseAndRecv() (*TestResponse, error) grpc.ClientStream }
type TestService_StreamServer ¶
type TestService_StreamServer interface { SendAndClose(*TestResponse) error Recv() (*SendRequest, error) grpc.ServerStream }