feat(service): expose wildcard-aware resolve API
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
bcf714d54c
commit
b6f9d50393
1 changed files with 11 additions and 0 deletions
11
service.go
11
service.go
|
|
@ -790,6 +790,17 @@ func (service *Service) Resolve(name string) (ResolveAllResult, bool) {
|
|||
return resolveResult(record), true
|
||||
}
|
||||
|
||||
// ResolveWithWildcardMatch returns all record types and whether the match used a wildcard.
|
||||
//
|
||||
// result, ok, usedWildcard := service.ResolveWithWildcardMatch("node.charon.lthn")
|
||||
func (service *Service) ResolveWithWildcardMatch(name string) (ResolveAllResult, bool, bool) {
|
||||
record, ok, usedWildcard := service.findRecordWithMatch(name)
|
||||
if !ok {
|
||||
return ResolveAllResult{}, false, false
|
||||
}
|
||||
return resolveResult(record), true, usedWildcard
|
||||
}
|
||||
|
||||
// ResolveWithMatch returns matching records and whether the match used a wildcard.
|
||||
//
|
||||
// result, found, usedWildcard := service.ResolveWithMatch("node.charon.lthn")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue