registry/memory: add support for domain options (#1713)
* registry/memory: add support for the domain options * registry/memory: swap Fatal test cases with Error * registry/memory: fix wildcard not found bug * registry/memory: replace locks with rlocks * registry/memory: fix deregistration bug
This commit is contained in:
@@ -35,12 +35,15 @@ func serviceToRecord(s *registry.Service, ttl time.Duration) *record {
|
||||
}
|
||||
}
|
||||
|
||||
func recordToService(r *record) *registry.Service {
|
||||
func recordToService(r *record, domain string) *registry.Service {
|
||||
metadata := make(map[string]string, len(r.Metadata))
|
||||
for k, v := range r.Metadata {
|
||||
metadata[k] = v
|
||||
}
|
||||
|
||||
// set the domain in metadata so it can be determined when a wildcard query is performed
|
||||
metadata["domain"] = domain
|
||||
|
||||
endpoints := make([]*registry.Endpoint, len(r.Endpoints))
|
||||
for i, e := range r.Endpoints {
|
||||
request := new(registry.Value)
|
||||
|
Reference in New Issue
Block a user