Documentation ¶
Index ¶
- type MockHandler
- type MockServer
- func (m *MockServer) Deregister() error
- func (m *MockServer) Handle(h server.Handler) error
- func (m *MockServer) Init(opts ...server.Option) error
- func (m *MockServer) NewHandler(h interface{}, opts ...server.HandlerOption) server.Handler
- func (m *MockServer) NewSubscriber(topic string, fn interface{}, opts ...server.SubscriberOption) server.Subscriber
- func (m *MockServer) Options() server.Options
- func (m *MockServer) Register() error
- func (m *MockServer) Start() error
- func (m *MockServer) Stop() error
- func (m *MockServer) String() string
- func (m *MockServer) Subscribe(sub server.Subscriber) error
- type MockSubscriber
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) 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 (m *MockSubscriber) Options() server.SubscriberOptions
func (*MockSubscriber) Subscriber ¶
func (m *MockSubscriber) Subscriber() interface{}
func (*MockSubscriber) Topic ¶
func (m *MockSubscriber) Topic() string
Click to show internal directories.
Click to hide internal directories.