Documentation ¶
Index ¶
- type MapStore
- func (m *MapStore) AddClient(c *stela.Client) error
- func (m *MapStore) Client(id string) (*stela.Client, error)
- func (m *MapStore) Deregister(s *stela.Service) *stela.Service
- func (m *MapStore) Discover(serviceName string) ([]*stela.Service, error)
- func (m *MapStore) DiscoverAll() []*stela.Service
- func (m *MapStore) DiscoverOne(serviceName string) (*stela.Service, error)
- func (m *MapStore) DiscoverRegex(reg string) ([]*stela.Service, error)
- func (m *MapStore) NotifyClients(s *stela.Service)
- func (m *MapStore) Register(s *stela.Service) error
- func (m *MapStore) RemoveClient(c *stela.Client)
- func (m *MapStore) ServicesByClient(c *stela.Client) []*stela.Service
- func (m *MapStore) Subscribe(serviceName string, c *stela.Client) error
- func (m *MapStore) Unsubscribe(serviceName string, c *stela.Client) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MapStore ¶
type MapStore struct {
// contains filtered or unexported fields
}
MapStore implements the Store interface creating an in memory map of stela.Services
func (*MapStore) Deregister ¶
Deregister removes a service from the map and returns the service it deregistered
func (*MapStore) DiscoverAll ¶
DiscoverAll returns all the services registered with the store
func (*MapStore) DiscoverOne ¶
DiscoverOne returns only one of the services registered under a serviceName
func (*MapStore) DiscoverRegex ¶
DiscoverRegex finds all services registered from a regular expression https://golang.org/pkg/regexp/#MatchString
func (*MapStore) NotifyClients ¶
NotifyClients let's all locally subscribed clients, on this stela instance, know about service subscription changes
func (*MapStore) Register ¶
Register takes a service adding it to the services map and let's all client subscriers know
func (*MapStore) RemoveClient ¶
RemoveClient removes client from the slice m.clients, services it registered and any subscriptions
func (*MapStore) ServicesByClient ¶
ServicesByClient returns all services a client has registered