More cleanup - needs to think a little about NewSOA()

This commit is contained in:
Miek Gieben
2016-03-22 10:29:48 +00:00
parent 22dade9e12
commit 1a7f0deadd
5 changed files with 138 additions and 114 deletions

View File

@@ -147,6 +147,14 @@ func (g Etcd) Ttl(node *etcdc.Node, serv *msg.Service) uint32 {
return serv.Ttl
}
// etcNameError checks if the error is ErrorCodeKeyNotFound from etcd.
func isEtcdNameError(err error) bool {
if e, ok := err.(etcdc.Error); ok && e.Code == etcdc.ErrorCodeKeyNotFound {
return true
}
return false
}
const (
priority = 10 // default priority when nothing is set
ttl = 300 // default ttl when nothing is set