From b6f9d50393a4eca4c680501d3fc7bf70b2d961e5 Mon Sep 17 00:00:00 2001 From: Virgil Date: Sat, 4 Apr 2026 00:02:17 +0000 Subject: [PATCH] feat(service): expose wildcard-aware resolve API Co-Authored-By: Virgil --- service.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/service.go b/service.go index 546869e..bc159fb 100644 --- a/service.go +++ b/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")