mock

package
v2.9.3 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockHandler

type MockHandler struct {
	Id   string
	Opts server.HandlerOptions
	Hdlr interface{}
}

func (*MockHandler) Endpoints

func (m *MockHandler) Endpoints() []*registry.Endpoint

func (*MockHandler) Handler

func (m *MockHandler) Handler() interface{}

func (*MockHandler) Name

func (m *MockHandler) Name() string

func (*MockHandler) Options

func (m *MockHandler) Options() server.HandlerOptions

type MockServer

type MockServer struct {
	sync.Mutex
	Running     bool
	Opts        server.Options
	Handlers    map[string]server.Handler
	Subscribers map[string][]server.Subscriber
}

func NewServer

func NewServer(opts ...server.Option) *MockServer

func (*MockServer) Deregister

func (m *MockServer) Deregister() error

func (*MockServer) Handle

func (m *MockServer) Handle(h server.Handler) error

func (*MockServer) Init

func (m *MockServer) Init(opts ...server.Option) error

func (*MockServer) NewHandler

func (m *MockServer) NewHandler(h interface{}, opts ...server.HandlerOption) server.Handler

func (*MockServer) NewSubscriber

func (m *MockServer) NewSubscriber(topic string, fn interface{}, opts ...server.SubscriberOption) server.Subscriber

func (*MockServer) Options

func (m *MockServer) Options() server.Options

func (*MockServer) Register

func (m *MockServer) Register() error

func (*MockServer) Start

func (m *MockServer) Start() error

func (*MockServer) Stop

func (m *MockServer) Stop() error

func (*MockServer) String

func (m *MockServer) String() string

func (*MockServer) Subscribe

func (m *MockServer) Subscribe(sub server.Subscriber) error

type MockSubscriber

type MockSubscriber struct {
	Id   string
	Opts server.SubscriberOptions
	Sub  interface{}
}

func (*MockSubscriber) Endpoints

func (m *MockSubscriber) Endpoints() []*registry.Endpoint

func (*MockSubscriber) Options

func (*MockSubscriber) Subscriber

func (m *MockSubscriber) Subscriber() interface{}

func (*MockSubscriber) Topic

func (m *MockSubscriber) Topic() string

Jump to

Keyboard shortcuts

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