e2e_mock

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const SRPCMockServiceID = "e2e.mock.Mock"

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_starpc_e2e_mock_mock_proto protoreflect.FileDescriptor

Functions

func NewSRPCMockHandler

func NewSRPCMockHandler(impl SRPCMockServer, serviceID string) srpc.Handler

NewSRPCMockHandler constructs a new RPC handler. serviceID: if empty, uses default: e2e.mock.Mock

func SRPCRegisterMock

func SRPCRegisterMock(mux srpc.Mux, impl SRPCMockServer) error

SRPCRegisterMock registers the implementation with the mux. Uses the default serviceID: e2e.mock.Mock

Types

type MockMsg

type MockMsg struct {
	Body string `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

MockMsg is the mock message body.

func (*MockMsg) CloneMessageVT added in v0.18.3

func (m *MockMsg) CloneMessageVT() proto.Message

func (*MockMsg) CloneVT

func (m *MockMsg) CloneVT() *MockMsg

func (*MockMsg) Descriptor deprecated

func (*MockMsg) Descriptor() ([]byte, []int)

Deprecated: Use MockMsg.ProtoReflect.Descriptor instead.

func (*MockMsg) EqualMessageVT added in v0.18.3

func (this *MockMsg) EqualMessageVT(thatMsg proto.Message) bool

func (*MockMsg) EqualVT

func (this *MockMsg) EqualVT(that *MockMsg) bool

func (*MockMsg) GetBody

func (x *MockMsg) GetBody() string

func (*MockMsg) MarshalToSizedBufferVT

func (m *MockMsg) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*MockMsg) MarshalToVT

func (m *MockMsg) MarshalToVT(dAtA []byte) (int, error)

func (*MockMsg) MarshalVT

func (m *MockMsg) MarshalVT() (dAtA []byte, err error)

func (*MockMsg) ProtoMessage

func (*MockMsg) ProtoMessage()

func (*MockMsg) ProtoReflect

func (x *MockMsg) ProtoReflect() protoreflect.Message

func (*MockMsg) Reset

func (x *MockMsg) Reset()

func (*MockMsg) SizeVT

func (m *MockMsg) SizeVT() (n int)

func (*MockMsg) String

func (x *MockMsg) String() string

func (*MockMsg) UnmarshalVT

func (m *MockMsg) UnmarshalVT(dAtA []byte) error

type MockServer

type MockServer struct {
	// MockRequestCb is the callback to implement MockRequest.
	MockRequestCb func(ctx context.Context, msg *MockMsg) (*MockMsg, error)
}

MockServer implements the server for Mock.

func (*MockServer) MockRequest

func (e *MockServer) MockRequest(ctx context.Context, msg *MockMsg) (*MockMsg, error)

MockRequest implements the mock request rpc.

func (*MockServer) Register

func (e *MockServer) Register(mux srpc.Mux) error

Register registers the Echo server with the Mux.

type SRPCMockClient

type SRPCMockClient interface {
	SRPCClient() srpc.Client

	MockRequest(ctx context.Context, in *MockMsg) (*MockMsg, error)
}

func NewSRPCMockClient

func NewSRPCMockClient(cc srpc.Client) SRPCMockClient

func NewSRPCMockClientWithServiceID

func NewSRPCMockClientWithServiceID(cc srpc.Client, serviceID string) SRPCMockClient

type SRPCMockHandler

type SRPCMockHandler struct {
	// contains filtered or unexported fields
}

func (SRPCMockHandler) GetMethodIDs

func (SRPCMockHandler) GetMethodIDs() []string

func (*SRPCMockHandler) GetServiceID

func (d *SRPCMockHandler) GetServiceID() string

func (*SRPCMockHandler) InvokeMethod

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

func (SRPCMockHandler) InvokeMethod_MockRequest

func (SRPCMockHandler) InvokeMethod_MockRequest(impl SRPCMockServer, strm srpc.Stream) error

type SRPCMockServer

type SRPCMockServer interface {
	MockRequest(context.Context, *MockMsg) (*MockMsg, error)
}

type SRPCMockUnimplementedServer

type SRPCMockUnimplementedServer struct{}

func (*SRPCMockUnimplementedServer) MockRequest

type SRPCMock_MockRequestStream

type SRPCMock_MockRequestStream interface {
	srpc.Stream
}

Jump to

Keyboard shortcuts

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