Documentation ¶
Index ¶
- Constants
- Variables
- func DRPCRegisterEndToEnd(mux drpc.Mux, impl DRPCEndToEndServer) error
- func NewSRPCEndToEndHandler(impl SRPCEndToEndServer, serviceID string) srpc.Handler
- func SRPCRegisterEndToEnd(mux srpc.Mux, impl SRPCEndToEndServer) error
- type DRPCEndToEndClient
- type DRPCEndToEndDescription
- type DRPCEndToEndServer
- type DRPCEndToEndUnimplementedServer
- type DRPCEndToEnd_MockStream
- type MockRequest
- func (m *MockRequest) CloneGenericVT() proto.Message
- func (m *MockRequest) CloneVT() *MockRequest
- func (*MockRequest) Descriptor() ([]byte, []int)deprecated
- func (this *MockRequest) EqualVT(that *MockRequest) bool
- func (x *MockRequest) GetBody() string
- func (m *MockRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *MockRequest) MarshalToVT(dAtA []byte) (int, error)
- func (m *MockRequest) MarshalVT() (dAtA []byte, err error)
- func (*MockRequest) ProtoMessage()
- func (x *MockRequest) ProtoReflect() protoreflect.Message
- func (x *MockRequest) Reset()
- func (m *MockRequest) SizeVT() (n int)
- func (x *MockRequest) String() string
- func (m *MockRequest) UnmarshalVT(dAtA []byte) error
- type MockResponse
- func (m *MockResponse) CloneGenericVT() proto.Message
- func (m *MockResponse) CloneVT() *MockResponse
- func (*MockResponse) Descriptor() ([]byte, []int)deprecated
- func (this *MockResponse) EqualVT(that *MockResponse) bool
- func (x *MockResponse) GetReqBody() string
- func (m *MockResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *MockResponse) MarshalToVT(dAtA []byte) (int, error)
- func (m *MockResponse) MarshalVT() (dAtA []byte, err error)
- func (*MockResponse) ProtoMessage()
- func (x *MockResponse) ProtoReflect() protoreflect.Message
- func (x *MockResponse) Reset()
- func (m *MockResponse) SizeVT() (n int)
- func (x *MockResponse) String() string
- func (m *MockResponse) UnmarshalVT(dAtA []byte) error
- type SRPCEndToEndClient
- type SRPCEndToEndHandler
- type SRPCEndToEndServer
- type SRPCEndToEndUnimplementedServer
- type SRPCEndToEnd_MockStream
- type Server
Constants ¶
View Source
const ProtocolID protocol.ID = "bifrost/stream/drpc/e2e"
ProtocolID is the protocol ID for the end-to-end test.
View Source
const SRPCEndToEndServiceID = "drpc.e2e.EndToEnd"
Variables ¶
View Source
var ( ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflow = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") )
View Source
var File_github_com_aperturerobotics_bifrost_stream_drpc_e2e_e2e_proto protoreflect.FileDescriptor
Functions ¶
func DRPCRegisterEndToEnd ¶
func DRPCRegisterEndToEnd(mux drpc.Mux, impl DRPCEndToEndServer) error
func NewSRPCEndToEndHandler ¶ added in v0.7.2
func NewSRPCEndToEndHandler(impl SRPCEndToEndServer, serviceID string) srpc.Handler
NewSRPCEndToEndHandler constructs a new RPC handler. serviceID: if empty, uses default: drpc.e2e.EndToEnd
func SRPCRegisterEndToEnd ¶ added in v0.3.0
func SRPCRegisterEndToEnd(mux srpc.Mux, impl SRPCEndToEndServer) error
SRPCRegisterEndToEnd registers the implementation with the mux. Uses the default serviceID: drpc.e2e.EndToEnd
Types ¶
type DRPCEndToEndClient ¶
type DRPCEndToEndClient interface { DRPCConn() drpc.Conn Mock(ctx context.Context, in *MockRequest) (*MockResponse, error) }
func NewDRPCEndToEndClient ¶
func NewDRPCEndToEndClient(cc drpc.Conn) DRPCEndToEndClient
type DRPCEndToEndDescription ¶
type DRPCEndToEndDescription struct{}
func (DRPCEndToEndDescription) NumMethods ¶
func (DRPCEndToEndDescription) NumMethods() int
type DRPCEndToEndServer ¶
type DRPCEndToEndServer interface {
Mock(context.Context, *MockRequest) (*MockResponse, error)
}
type DRPCEndToEndUnimplementedServer ¶
type DRPCEndToEndUnimplementedServer struct{}
func (*DRPCEndToEndUnimplementedServer) Mock ¶
func (s *DRPCEndToEndUnimplementedServer) Mock(context.Context, *MockRequest) (*MockResponse, error)
type DRPCEndToEnd_MockStream ¶
type DRPCEndToEnd_MockStream interface { drpc.Stream SendAndClose(*MockResponse) error }
type MockRequest ¶
type MockRequest struct { // Body is the body of the request. Body string `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` // contains filtered or unexported fields }
MockRequest is the mock request.
func (*MockRequest) CloneGenericVT ¶ added in v0.8.3
func (m *MockRequest) CloneGenericVT() proto.Message
func (*MockRequest) CloneVT ¶ added in v0.8.3
func (m *MockRequest) CloneVT() *MockRequest
func (*MockRequest) Descriptor
deprecated
func (*MockRequest) Descriptor() ([]byte, []int)
Deprecated: Use MockRequest.ProtoReflect.Descriptor instead.
func (*MockRequest) EqualVT ¶ added in v0.3.0
func (this *MockRequest) EqualVT(that *MockRequest) bool
func (*MockRequest) GetBody ¶
func (x *MockRequest) GetBody() string
func (*MockRequest) MarshalToSizedBufferVT ¶ added in v0.2.0
func (m *MockRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*MockRequest) MarshalToVT ¶ added in v0.2.0
func (m *MockRequest) MarshalToVT(dAtA []byte) (int, error)
func (*MockRequest) MarshalVT ¶ added in v0.2.0
func (m *MockRequest) MarshalVT() (dAtA []byte, err error)
func (*MockRequest) ProtoMessage ¶
func (*MockRequest) ProtoMessage()
func (*MockRequest) ProtoReflect ¶ added in v0.2.0
func (x *MockRequest) ProtoReflect() protoreflect.Message
func (*MockRequest) Reset ¶
func (x *MockRequest) Reset()
func (*MockRequest) SizeVT ¶ added in v0.2.0
func (m *MockRequest) SizeVT() (n int)
func (*MockRequest) String ¶
func (x *MockRequest) String() string
func (*MockRequest) UnmarshalVT ¶ added in v0.2.0
func (m *MockRequest) UnmarshalVT(dAtA []byte) error
type MockResponse ¶
type MockResponse struct { // ReqBody is the echoed request body. ReqBody string `protobuf:"bytes,1,opt,name=req_body,json=reqBody,proto3" json:"req_body,omitempty"` // contains filtered or unexported fields }
MockResponse is the mock response.
func (*MockResponse) CloneGenericVT ¶ added in v0.8.3
func (m *MockResponse) CloneGenericVT() proto.Message
func (*MockResponse) CloneVT ¶ added in v0.8.3
func (m *MockResponse) CloneVT() *MockResponse
func (*MockResponse) Descriptor
deprecated
func (*MockResponse) Descriptor() ([]byte, []int)
Deprecated: Use MockResponse.ProtoReflect.Descriptor instead.
func (*MockResponse) EqualVT ¶ added in v0.3.0
func (this *MockResponse) EqualVT(that *MockResponse) bool
func (*MockResponse) GetReqBody ¶
func (x *MockResponse) GetReqBody() string
func (*MockResponse) MarshalToSizedBufferVT ¶ added in v0.2.0
func (m *MockResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*MockResponse) MarshalToVT ¶ added in v0.2.0
func (m *MockResponse) MarshalToVT(dAtA []byte) (int, error)
func (*MockResponse) MarshalVT ¶ added in v0.2.0
func (m *MockResponse) MarshalVT() (dAtA []byte, err error)
func (*MockResponse) ProtoMessage ¶
func (*MockResponse) ProtoMessage()
func (*MockResponse) ProtoReflect ¶ added in v0.2.0
func (x *MockResponse) ProtoReflect() protoreflect.Message
func (*MockResponse) Reset ¶
func (x *MockResponse) Reset()
func (*MockResponse) SizeVT ¶ added in v0.2.0
func (m *MockResponse) SizeVT() (n int)
func (*MockResponse) String ¶
func (x *MockResponse) String() string
func (*MockResponse) UnmarshalVT ¶ added in v0.2.0
func (m *MockResponse) UnmarshalVT(dAtA []byte) error
type SRPCEndToEndClient ¶ added in v0.3.0
type SRPCEndToEndClient interface { SRPCClient() srpc.Client Mock(ctx context.Context, in *MockRequest) (*MockResponse, error) }
func NewSRPCEndToEndClient ¶ added in v0.3.0
func NewSRPCEndToEndClient(cc srpc.Client) SRPCEndToEndClient
func NewSRPCEndToEndClientWithServiceID ¶ added in v0.7.2
func NewSRPCEndToEndClientWithServiceID(cc srpc.Client, serviceID string) SRPCEndToEndClient
type SRPCEndToEndHandler ¶ added in v0.3.0
type SRPCEndToEndHandler struct {
// contains filtered or unexported fields
}
func (SRPCEndToEndHandler) GetMethodIDs ¶ added in v0.3.0
func (SRPCEndToEndHandler) GetMethodIDs() []string
func (*SRPCEndToEndHandler) GetServiceID ¶ added in v0.3.0
func (d *SRPCEndToEndHandler) GetServiceID() string
func (*SRPCEndToEndHandler) InvokeMethod ¶ added in v0.3.0
func (SRPCEndToEndHandler) InvokeMethod_Mock ¶ added in v0.3.0
func (SRPCEndToEndHandler) InvokeMethod_Mock(impl SRPCEndToEndServer, strm srpc.Stream) error
type SRPCEndToEndServer ¶ added in v0.3.0
type SRPCEndToEndServer interface {
Mock(context.Context, *MockRequest) (*MockResponse, error)
}
type SRPCEndToEndUnimplementedServer ¶ added in v0.3.0
type SRPCEndToEndUnimplementedServer struct{}
func (*SRPCEndToEndUnimplementedServer) Mock ¶ added in v0.3.0
func (s *SRPCEndToEndUnimplementedServer) Mock(context.Context, *MockRequest) (*MockResponse, error)
type SRPCEndToEnd_MockStream ¶ added in v0.3.0
type SRPCEndToEnd_MockStream interface { srpc.Stream SendAndClose(*MockResponse) error }
type Server ¶
type Server struct { }
Server is the e2e server.
func (*Server) Mock ¶
func (s *Server) Mock(ctx context.Context, req *MockRequest) (*MockResponse, error)
Mock performs the mock request.
Click to show internal directories.
Click to hide internal directories.