Skip to content

Commit

Permalink
Fixed Mock Interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
king-jam committed Oct 14, 2016
1 parent 91cf681 commit dabd7e9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions libreg/registry/mock/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ func (m *Mock) Nodes(options *registry.QueryOptions) ([]*registry.Node, error) {
return keys, nil
}

// NodesWatch watches for changes to the nodes in a given DC
func (m *Mock) NodesWatch(options *registry.QueryOptions, stopChan <-chan struct{}) (<-chan []*registry.Node, error) {
watchCh := make(chan []*registry.Node)
return watchCh, nil
}

// Services lists all services in a given DC
func (m *Mock) Services(options *registry.QueryOptions) (map[string][]string, error) {
serviceMap := make(map[string][]string)
Expand All @@ -115,6 +121,12 @@ func (m *Mock) Services(options *registry.QueryOptions) (map[string][]string, er
return serviceMap, nil
}

// ServicesWatch watches for changes to the list of services in a given DC
func (m *Mock) ServicesWatch(options *registry.QueryOptions, stopChan <-chan struct{}) (<-chan map[string][]string, error) {
watchCh := make(chan map[string][]string)
return watchCh, nil
}

// Service lists the nodes in a given service
func (m *Mock) Service(service, tag string, options *registry.QueryOptions) ([]*registry.CatalogService, error) {
var c []*registry.CatalogService
Expand Down Expand Up @@ -151,6 +163,12 @@ func (m *Mock) Service(service, tag string, options *registry.QueryOptions) ([]*
return c, nil
}

// ServiceWatch watches for changes to the list of nodes under a given service
func (m *Mock) ServiceWatch(service, tag string, options *registry.QueryOptions, stopChan <-chan struct{}) (<-chan []*registry.CatalogService, error) {
watchCh := make(chan []*registry.CatalogService)
return watchCh, nil
}

// Node lists the services provided by a given node
func (m *Mock) Node(node string, options *registry.QueryOptions) (*registry.CatalogNode, error) {
if node == "" {
Expand Down

0 comments on commit dabd7e9

Please sign in to comment.