[agent/codex:gpt-5.4-mini] Read docs/RFC.md fully. Find ONE feature described in the sp... #31
2 changed files with 28 additions and 1 deletions
11
service.go
11
service.go
|
|
@ -68,9 +68,18 @@ type ServiceOptions struct {
|
|||
TreeRootCheckInterval time.Duration
|
||||
}
|
||||
|
||||
// Options is the documented constructor shape for NewService.
|
||||
//
|
||||
// service := dns.NewService(dns.Options{
|
||||
// Records: map[string]dns.NameRecords{
|
||||
// "gateway.charon.lthn": {A: []string{"10.10.10.10"}},
|
||||
// },
|
||||
// })
|
||||
type Options = ServiceOptions
|
||||
|
||||
// NewService builds a DNS service from cached records and optional discovery hooks.
|
||||
//
|
||||
// service := dns.NewService(dns.ServiceOptions{
|
||||
// service := dns.NewService(dns.Options{
|
||||
// Records: map[string]dns.NameRecords{
|
||||
// "gateway.charon.lthn": {A: []string{"10.10.10.10"}},
|
||||
// },
|
||||
|
|
|
|||
|
|
@ -54,6 +54,24 @@ func TestServiceResolveUsesExactNameBeforeWildcard(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestServiceOptionsAliasBuildsService(t *testing.T) {
|
||||
service := NewService(Options{
|
||||
Records: map[string]NameRecords{
|
||||
"gateway.charon.lthn": {
|
||||
A: []string{"10.10.10.10"},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
result, ok := service.ResolveAddress("gateway.charon.lthn")
|
||||
if !ok {
|
||||
t.Fatal("expected service constructed from Options alias to resolve")
|
||||
}
|
||||
if len(result.Addresses) != 1 || result.Addresses[0] != "10.10.10.10" {
|
||||
t.Fatalf("unexpected resolve result from Options alias: %#v", result.Addresses)
|
||||
}
|
||||
}
|
||||
|
||||
func TestServiceResolveUsesMostSpecificWildcard(t *testing.T) {
|
||||
service := NewService(ServiceOptions{
|
||||
Records: map[string]NameRecords{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue