drpc_e2e

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

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 SRPCRegisterEndToEnd added in v0.3.0

func SRPCRegisterEndToEnd(mux srpc.Mux, impl SRPCEndToEndServer) error

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) Method

func (DRPCEndToEndDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool)

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

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) 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) 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

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 (SRPCEndToEndHandler) GetServiceID() string

func (*SRPCEndToEndHandler) InvokeMethod added in v0.3.0

func (d *SRPCEndToEndHandler) InvokeMethod(
	serviceID, methodID string,
	strm srpc.Stream,
) (bool, error)

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

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 NewServer

func NewServer() *Server

NewServer constructs the server.

func (*Server) Mock

func (s *Server) Mock(ctx context.Context, req *MockRequest) (*MockResponse, error)

Mock performs the mock request.

func (*Server) Register

func (s *Server) Register(mux drpc.Mux) error

Register registers the API with a DRPC mux.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL