go-micro: github.com/micro/go-micro/server/mock Index | Files

package mock

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

Index

Package Files

mock.go mock_handler.go mock_subscriber.go

type MockHandler Uses

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

func (*MockHandler) Endpoints Uses

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

func (*MockHandler) Handler Uses

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

func (*MockHandler) Name Uses

func (m *MockHandler) Name() string

func (*MockHandler) Options Uses

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

type MockServer Uses

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

func NewServer Uses

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

func (*MockServer) Deregister Uses

func (m *MockServer) Deregister() error

func (*MockServer) Handle Uses

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

func (*MockServer) Init Uses

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

func (*MockServer) NewHandler Uses

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

func (*MockServer) NewSubscriber Uses

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

func (*MockServer) Options Uses

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

func (*MockServer) Register Uses

func (m *MockServer) Register() error

func (*MockServer) Start Uses

func (m *MockServer) Start() error

func (*MockServer) Stop Uses

func (m *MockServer) Stop() error

func (*MockServer) String Uses

func (m *MockServer) String() string

func (*MockServer) Subscribe Uses

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

type MockSubscriber Uses

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

func (*MockSubscriber) Endpoints Uses

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

func (*MockSubscriber) Options Uses

func (m *MockSubscriber) Options() server.SubscriberOptions

func (*MockSubscriber) Subscriber Uses

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

func (*MockSubscriber) Topic Uses

func (m *MockSubscriber) Topic() string

Package mock imports 5 packages (graph). Updated 2018-12-18. Refresh now. Tools for package owners.