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

2
Godeps/Godeps.json generated
View File

@ -104,7 +104,7 @@
},
{
"ImportPath": "github.com/xiang90/probing",
"Rev": "e8a0407769cb84c61c2ddf8f1d9cdae9fb489b9b"
"Rev": "11caf1c32ca4055f97e55541e92a75966635981d"
},
{
"ImportPath": "golang.org/x/crypto/bcrypt",

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()