godeps: update probing pkg

This commit is contained in:
Xiang Li
2015-08-04 17:40:39 +08:00
parent 0fc764200d
commit 709718ed97
2 changed files with 12 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ var (
type Prober interface {
AddHTTP(id string, probingInterval time.Duration, endpoints []string) error
Remove(id string) error
RemoveAll()
Reset(id string) error
Status(id string) (Status, error)
}
@@ -88,6 +89,16 @@ func (p *prober) Remove(id string) error {
return nil
}
func (p *prober) RemoveAll() {
p.mu.Lock()
defer p.mu.Unlock()
for _, s := range p.targets {
close(s.stopC)
}
p.targets = make(map[string]*status)
}
func (p *prober) Reset(id string) error {
p.mu.Lock()
defer p.mu.Unlock()