Skip to content

Commit

Permalink
added equals function for kv
Browse files Browse the repository at this point in the history
  • Loading branch information
mgaida committed Aug 29, 2017
1 parent 6ff875f commit 464d98d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions consul/consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,9 @@ func (c *Consul) WriteKVs(kvs []KV, keepDC bool) error {
}
return c.writeKV(kvs, keepDC)
}

func (kv *KV) Equals(ckv KV) bool {
return (kv.Datacenter == ckv.Datacenter) &&
(kv.Key == ckv.Key) &&
(string(kv.Value[:]) == string(ckv.Value[:]))
}

0 comments on commit 464d98d

Please sign in to comment.