drpc_e2e

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: Apache-2.0 Imports: 8 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.

Variables

This section is empty.

Functions

func DRPCRegisterEndToEnd

func DRPCRegisterEndToEnd(mux drpc.Mux, impl DRPCEndToEndServer) 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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MockRequest is the mock request.

func (*MockRequest) Descriptor

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

func (*MockRequest) GetBody

func (m *MockRequest) GetBody() string

func (*MockRequest) ProtoMessage

func (*MockRequest) ProtoMessage()

func (*MockRequest) Reset

func (m *MockRequest) Reset()

func (*MockRequest) String

func (m *MockRequest) String() string

func (*MockRequest) XXX_DiscardUnknown

func (m *MockRequest) XXX_DiscardUnknown()

func (*MockRequest) XXX_Marshal

func (m *MockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MockRequest) XXX_Merge

func (m *MockRequest) XXX_Merge(src proto.Message)

func (*MockRequest) XXX_Size

func (m *MockRequest) XXX_Size() int

func (*MockRequest) XXX_Unmarshal

func (m *MockRequest) XXX_Unmarshal(b []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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MockResponse is the mock response.

func (*MockResponse) Descriptor

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

func (*MockResponse) GetReqBody

func (m *MockResponse) GetReqBody() string

func (*MockResponse) ProtoMessage

func (*MockResponse) ProtoMessage()

func (*MockResponse) Reset

func (m *MockResponse) Reset()

func (*MockResponse) String

func (m *MockResponse) String() string

func (*MockResponse) XXX_DiscardUnknown

func (m *MockResponse) XXX_DiscardUnknown()

func (*MockResponse) XXX_Marshal

func (m *MockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MockResponse) XXX_Merge

func (m *MockResponse) XXX_Merge(src proto.Message)

func (*MockResponse) XXX_Size

func (m *MockResponse) XXX_Size() int

func (*MockResponse) XXX_Unmarshal

func (m *MockResponse) XXX_Unmarshal(b []byte) 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