e2e_mock

package
v0.31.5 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

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() protobuf_go_lite.CloneMessage

func (*MockMsg) CloneVT

func (m *MockMsg) CloneVT() *MockMsg

func (*MockMsg) EqualMessageVT added in v0.18.3

func (this *MockMsg) EqualMessageVT(thatMsg any) bool

func (*MockMsg) EqualVT

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

func (*MockMsg) GetBody

func (x *MockMsg) GetBody() string

func (*MockMsg) MarshalJSON added in v0.30.0

func (x *MockMsg) MarshalJSON() ([]byte, error)

MarshalJSON marshals the MockMsg to JSON.

func (*MockMsg) MarshalProtoJSON added in v0.30.0

func (x *MockMsg) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the MockMsg message to JSON.

func (*MockMsg) MarshalProtoText added in v0.31.4

func (x *MockMsg) MarshalProtoText() 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) Reset

func (x *MockMsg) Reset()

func (*MockMsg) SizeVT

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

func (*MockMsg) String

func (x *MockMsg) String() string

func (*MockMsg) UnmarshalJSON added in v0.30.1

func (x *MockMsg) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the MockMsg from JSON.

func (*MockMsg) UnmarshalProtoJSON added in v0.30.1

func (x *MockMsg) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the MockMsg message from JSON.

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