mock - ActiveState ActiveGo 1.8
...

Package mock

import "github.com/micro/go-micro/server/mock"
Overview
Index

Overview ▾

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 (m *MockSubscriber) Options() server.SubscriberOptions

func (*MockSubscriber) Subscriber

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

func (*MockSubscriber) Topic

func (m *MockSubscriber) Topic() string