transport

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockRequestHandler

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

MockRequestHandler implements a mock that implements RequestHandler interface

func NewMockRequestHandler

func NewMockRequestHandler(conf *config.Config) *MockRequestHandler

NewMockRequestHandler returns a new instance of *MockRequestHandler

func (*MockRequestHandler) Expect

func (rh *MockRequestHandler) Expect(cb handlerFunc)

func (*MockRequestHandler) PushRequest

func (rh *MockRequestHandler) PushRequest(ctx context.Context, req *protocol.Request) (*protocol.Response, error)

PushRequest implements RequestHandler interface

func (*MockRequestHandler) Respond

func (rh *MockRequestHandler) Respond(cb handlerFunc)

func (*MockRequestHandler) Stop

func (rh *MockRequestHandler) Stop() error

type RequestHandler

type RequestHandler interface {
	PushRequest(context.Context, *protocol.Request) (*protocol.Response, error)
}

RequestHandler lets a server push requests to the event q

type Server

type Server interface {
	GoServe()
	Stop() error
	ListenAddr() net.Addr
	SetHandler(h RequestHandler)
}

Server is used by events to start and stop servers

Jump to

Keyboard shortcuts

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