Documentation ¶
Overview ¶
Package testproto is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func InMemoryClientConn(t *testing.T, grpcSrv *grpc.Server) *grpc.ClientConn
- func RegisterTestHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterTestHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TestClient) error
- func RegisterTestHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterTestHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TestServer) error
- func RegisterTestServer(s grpc1.Server, srv TestServer)
- type TestClient
- type TestRequest
- func (*TestRequest) Descriptor() ([]byte, []int)
- func (m *TestRequest) GetRequest() string
- func (m *TestRequest) Marshal() (dAtA []byte, err error)
- func (m *TestRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *TestRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*TestRequest) ProtoMessage()
- func (m *TestRequest) Reset()
- func (m *TestRequest) Size() (n int)
- func (m *TestRequest) String() string
- func (m *TestRequest) Unmarshal(dAtA []byte) error
- func (m *TestRequest) XXX_DiscardUnknown()
- func (m *TestRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TestRequest) XXX_Merge(src proto.Message)
- func (m *TestRequest) XXX_Size() int
- func (m *TestRequest) XXX_Unmarshal(b []byte) error
- type TestResponse
- func (*TestResponse) Descriptor() ([]byte, []int)
- func (m *TestResponse) GetResponse() string
- func (m *TestResponse) Marshal() (dAtA []byte, err error)
- func (m *TestResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *TestResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*TestResponse) ProtoMessage()
- func (m *TestResponse) Reset()
- func (m *TestResponse) Size() (n int)
- func (m *TestResponse) String() string
- func (m *TestResponse) Unmarshal(dAtA []byte) error
- func (m *TestResponse) XXX_DiscardUnknown()
- func (m *TestResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TestResponse) XXX_Merge(src proto.Message)
- func (m *TestResponse) XXX_Size() int
- func (m *TestResponse) XXX_Unmarshal(b []byte) error
- type TestServer
- type UnimplementedTestServer
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func InMemoryClientConn ¶
InMemoryClientConn creates a grpc client connection to a grpc server which is listening on a random port.
func RegisterTestHandler ¶
RegisterTestHandler registers the http handlers for service Test to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterTestHandlerClient ¶
RegisterTestHandlerClient registers the http handlers for service Test to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TestClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TestClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TestClient" to call the correct interceptors.
func RegisterTestHandlerFromEndpoint ¶
func RegisterTestHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterTestHandlerFromEndpoint is same as RegisterTestHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterTestHandlerServer ¶
RegisterTestHandlerServer registers the http handlers for service Test to "mux". UnaryRPC :call TestServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTestHandlerFromEndpoint instead.
func RegisterTestServer ¶
func RegisterTestServer(s grpc1.Server, srv TestServer)
Types ¶
type TestClient ¶
type TestClient interface {
Test(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error)
}
TestClient is the client API for Test service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewTestClient ¶
func NewTestClient(cc grpc1.ClientConn) TestClient
type TestRequest ¶
type TestRequest struct {
Request string `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"`
}
func (*TestRequest) Descriptor ¶
func (*TestRequest) Descriptor() ([]byte, []int)
func (*TestRequest) GetRequest ¶
func (m *TestRequest) GetRequest() string
func (*TestRequest) Marshal ¶
func (m *TestRequest) Marshal() (dAtA []byte, err error)
func (*TestRequest) MarshalToSizedBuffer ¶
func (m *TestRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*TestRequest) ProtoMessage ¶
func (*TestRequest) ProtoMessage()
func (*TestRequest) Reset ¶
func (m *TestRequest) Reset()
func (*TestRequest) Size ¶
func (m *TestRequest) Size() (n int)
func (*TestRequest) String ¶
func (m *TestRequest) String() string
func (*TestRequest) Unmarshal ¶
func (m *TestRequest) Unmarshal(dAtA []byte) error
func (*TestRequest) XXX_DiscardUnknown ¶
func (m *TestRequest) XXX_DiscardUnknown()
func (*TestRequest) XXX_Marshal ¶
func (m *TestRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*TestRequest) XXX_Merge ¶
func (m *TestRequest) XXX_Merge(src proto.Message)
func (*TestRequest) XXX_Size ¶
func (m *TestRequest) XXX_Size() int
func (*TestRequest) XXX_Unmarshal ¶
func (m *TestRequest) XXX_Unmarshal(b []byte) error
type TestResponse ¶
type TestResponse struct {
Response string `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"`
}
func (*TestResponse) Descriptor ¶
func (*TestResponse) Descriptor() ([]byte, []int)
func (*TestResponse) GetResponse ¶
func (m *TestResponse) GetResponse() string
func (*TestResponse) Marshal ¶
func (m *TestResponse) Marshal() (dAtA []byte, err error)
func (*TestResponse) MarshalToSizedBuffer ¶
func (m *TestResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*TestResponse) ProtoMessage ¶
func (*TestResponse) ProtoMessage()
func (*TestResponse) Reset ¶
func (m *TestResponse) Reset()
func (*TestResponse) Size ¶
func (m *TestResponse) Size() (n int)
func (*TestResponse) String ¶
func (m *TestResponse) String() string
func (*TestResponse) Unmarshal ¶
func (m *TestResponse) Unmarshal(dAtA []byte) error
func (*TestResponse) XXX_DiscardUnknown ¶
func (m *TestResponse) XXX_DiscardUnknown()
func (*TestResponse) XXX_Marshal ¶
func (m *TestResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*TestResponse) XXX_Merge ¶
func (m *TestResponse) XXX_Merge(src proto.Message)
func (*TestResponse) XXX_Size ¶
func (m *TestResponse) XXX_Size() int
func (*TestResponse) XXX_Unmarshal ¶
func (m *TestResponse) XXX_Unmarshal(b []byte) error
type TestServer ¶
type TestServer interface {
Test(context.Context, *TestRequest) (*TestResponse, error)
}
TestServer is the server API for Test service.
type UnimplementedTestServer ¶
type UnimplementedTestServer struct { }
UnimplementedTestServer can be embedded to have forward compatible implementations.
func (*UnimplementedTestServer) Test ¶
func (*UnimplementedTestServer) Test(ctx context.Context, req *TestRequest) (*TestResponse, error)