Skip to content

Commit

Permalink
separate out HTTP api server from the rest of the service
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielc committed Mar 15, 2017
1 parent 9bf66a0 commit 6a43f80
Show file tree
Hide file tree
Showing 4 changed files with 542 additions and 502 deletions.
6 changes: 3 additions & 3 deletions alert/topics.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (s *Topics) TopicStatus(pattern string, minLevel Level) map[string]TopicSta
s.mu.RLock()
res := make(map[string]TopicStatus, len(s.topics))
for _, topic := range s.topics {
if !match(pattern, topic.ID()) {
if !PatternMatch(pattern, topic.ID()) {
continue
}
level := topic.MaxLevel()
Expand All @@ -192,7 +192,7 @@ func (s *Topics) TopicStatusEvents(pattern string, minLevel Level) map[string]ma
s.mu.RLock()
topics := make([]*Topic, 0, len(s.topics))
for _, topic := range s.topics {
if topic.MaxLevel() >= minLevel && match(pattern, topic.id) {
if topic.MaxLevel() >= minLevel && PatternMatch(pattern, topic.id) {
topics = append(topics, topic)
}
}
Expand All @@ -207,7 +207,7 @@ func (s *Topics) TopicStatusEvents(pattern string, minLevel Level) map[string]ma
return res
}

func match(pattern, id string) bool {
func PatternMatch(pattern, id string) bool {
if pattern == "" {
return true
}
Expand Down
Loading

0 comments on commit 6a43f80

Please sign in to comment.