Documentation ¶
Overview ¶
Package test is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterTestAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterTestAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TestAPIClient) error
- func RegisterTestAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterTestAPIServer(s *grpc.Server, srv TestAPIServer)
- type TestAPIClient
- type TestAPIServer
- type TimestampReq
- func (*TimestampReq) Descriptor() ([]byte, []int)
- func (m *TimestampReq) GetMyTime() *timestamp.Timestamp
- func (*TimestampReq) ProtoMessage()
- func (m *TimestampReq) Reset()
- func (m *TimestampReq) String() string
- func (m *TimestampReq) Validate() error
- func (m *TimestampReq) XXX_DiscardUnknown()
- func (m *TimestampReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TimestampReq) XXX_Merge(src proto.Message)
- func (m *TimestampReq) XXX_Size() int
- func (m *TimestampReq) XXX_Unmarshal(b []byte) error
- type TimestampReqValidationError
- func (e TimestampReqValidationError) Cause() error
- func (e TimestampReqValidationError) Error() string
- func (e TimestampReqValidationError) ErrorName() string
- func (e TimestampReqValidationError) Field() string
- func (e TimestampReqValidationError) Key() bool
- func (e TimestampReqValidationError) Reason() string
- type TimestampResp
- func (*TimestampResp) Descriptor() ([]byte, []int)
- func (m *TimestampResp) GetMyTime() *timestamp.Timestamp
- func (*TimestampResp) ProtoMessage()
- func (m *TimestampResp) Reset()
- func (m *TimestampResp) String() string
- func (m *TimestampResp) Validate() error
- func (m *TimestampResp) XXX_DiscardUnknown()
- func (m *TimestampResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TimestampResp) XXX_Merge(src proto.Message)
- func (m *TimestampResp) XXX_Size() int
- func (m *TimestampResp) XXX_Unmarshal(b []byte) error
- type TimestampRespValidationError
- func (e TimestampRespValidationError) Cause() error
- func (e TimestampRespValidationError) Error() string
- func (e TimestampRespValidationError) ErrorName() string
- func (e TimestampRespValidationError) Field() string
- func (e TimestampRespValidationError) Key() bool
- func (e TimestampRespValidationError) Reason() string
- type UnimplementedTestAPIServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTestAPIHandler ¶
func RegisterTestAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterTestAPIHandler registers the http handlers for service TestAPI to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterTestAPIHandlerClient ¶
func RegisterTestAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TestAPIClient) error
RegisterTestAPIHandlerClient registers the http handlers for service TestAPI to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TestAPIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TestAPIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TestAPIClient" to call the correct interceptors.
func RegisterTestAPIHandlerFromEndpoint ¶
func RegisterTestAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterTestAPIHandlerFromEndpoint is same as RegisterTestAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterTestAPIServer ¶
func RegisterTestAPIServer(s *grpc.Server, srv TestAPIServer)
Types ¶
type TestAPIClient ¶
type TestAPIClient interface {
Timestamp(ctx context.Context, in *TimestampReq, opts ...grpc.CallOption) (*TimestampResp, error)
}
TestAPIClient is the client API for TestAPI service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewTestAPIClient ¶
func NewTestAPIClient(cc *grpc.ClientConn) TestAPIClient
type TestAPIServer ¶
type TestAPIServer interface {
Timestamp(context.Context, *TimestampReq) (*TimestampResp, error)
}
TestAPIServer is the server API for TestAPI service.
type TimestampReq ¶
type TimestampReq struct { MyTime *timestamp.Timestamp `protobuf:"bytes,1,opt,name=my_time,json=myTime,proto3" json:"my_time,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*TimestampReq) Descriptor ¶
func (*TimestampReq) Descriptor() ([]byte, []int)
func (*TimestampReq) GetMyTime ¶
func (m *TimestampReq) GetMyTime() *timestamp.Timestamp
func (*TimestampReq) ProtoMessage ¶
func (*TimestampReq) ProtoMessage()
func (*TimestampReq) Reset ¶
func (m *TimestampReq) Reset()
func (*TimestampReq) String ¶
func (m *TimestampReq) String() string
func (*TimestampReq) Validate ¶
func (m *TimestampReq) Validate() error
Validate checks the field values on TimestampReq with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*TimestampReq) XXX_DiscardUnknown ¶
func (m *TimestampReq) XXX_DiscardUnknown()
func (*TimestampReq) XXX_Marshal ¶
func (m *TimestampReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*TimestampReq) XXX_Merge ¶
func (m *TimestampReq) XXX_Merge(src proto.Message)
func (*TimestampReq) XXX_Size ¶
func (m *TimestampReq) XXX_Size() int
func (*TimestampReq) XXX_Unmarshal ¶
func (m *TimestampReq) XXX_Unmarshal(b []byte) error
type TimestampReqValidationError ¶
type TimestampReqValidationError struct {
// contains filtered or unexported fields
}
TimestampReqValidationError is the validation error returned by TimestampReq.Validate if the designated constraints aren't met.
func (TimestampReqValidationError) Cause ¶
func (e TimestampReqValidationError) Cause() error
Cause function returns cause value.
func (TimestampReqValidationError) Error ¶
func (e TimestampReqValidationError) Error() string
Error satisfies the builtin error interface
func (TimestampReqValidationError) ErrorName ¶
func (e TimestampReqValidationError) ErrorName() string
ErrorName returns error name.
func (TimestampReqValidationError) Field ¶
func (e TimestampReqValidationError) Field() string
Field function returns field value.
func (TimestampReqValidationError) Key ¶
func (e TimestampReqValidationError) Key() bool
Key function returns key value.
func (TimestampReqValidationError) Reason ¶
func (e TimestampReqValidationError) Reason() string
Reason function returns reason value.
type TimestampResp ¶
type TimestampResp struct { MyTime *timestamp.Timestamp `protobuf:"bytes,1,opt,name=my_time,json=myTime,proto3" json:"my_time,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*TimestampResp) Descriptor ¶
func (*TimestampResp) Descriptor() ([]byte, []int)
func (*TimestampResp) GetMyTime ¶
func (m *TimestampResp) GetMyTime() *timestamp.Timestamp
func (*TimestampResp) ProtoMessage ¶
func (*TimestampResp) ProtoMessage()
func (*TimestampResp) Reset ¶
func (m *TimestampResp) Reset()
func (*TimestampResp) String ¶
func (m *TimestampResp) String() string
func (*TimestampResp) Validate ¶
func (m *TimestampResp) Validate() error
Validate checks the field values on TimestampResp with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*TimestampResp) XXX_DiscardUnknown ¶
func (m *TimestampResp) XXX_DiscardUnknown()
func (*TimestampResp) XXX_Marshal ¶
func (m *TimestampResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*TimestampResp) XXX_Merge ¶
func (m *TimestampResp) XXX_Merge(src proto.Message)
func (*TimestampResp) XXX_Size ¶
func (m *TimestampResp) XXX_Size() int
func (*TimestampResp) XXX_Unmarshal ¶
func (m *TimestampResp) XXX_Unmarshal(b []byte) error
type TimestampRespValidationError ¶
type TimestampRespValidationError struct {
// contains filtered or unexported fields
}
TimestampRespValidationError is the validation error returned by TimestampResp.Validate if the designated constraints aren't met.
func (TimestampRespValidationError) Cause ¶
func (e TimestampRespValidationError) Cause() error
Cause function returns cause value.
func (TimestampRespValidationError) Error ¶
func (e TimestampRespValidationError) Error() string
Error satisfies the builtin error interface
func (TimestampRespValidationError) ErrorName ¶
func (e TimestampRespValidationError) ErrorName() string
ErrorName returns error name.
func (TimestampRespValidationError) Field ¶
func (e TimestampRespValidationError) Field() string
Field function returns field value.
func (TimestampRespValidationError) Key ¶
func (e TimestampRespValidationError) Key() bool
Key function returns key value.
func (TimestampRespValidationError) Reason ¶
func (e TimestampRespValidationError) Reason() string
Reason function returns reason value.
type UnimplementedTestAPIServer ¶
type UnimplementedTestAPIServer struct { }
UnimplementedTestAPIServer can be embedded to have forward compatible implementations.
func (*UnimplementedTestAPIServer) Timestamp ¶
func (*UnimplementedTestAPIServer) Timestamp(ctx context.Context, req *TimestampReq) (*TimestampResp, error)