Implement libdns ZoneLister interface for provider

This commit is contained in:
Alexandre Oliveira 2023-03-31 16:15:31 +02:00
parent 44dad6df97
commit e079f301dd
3 changed files with 52 additions and 0 deletions

View file

@ -83,10 +83,21 @@ func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns
return setRecords, nil
}
func (p *Provider) ListZones(ctx context.Context) ([]libdns.Zone, error) {
zones, err := p.getDNSZones(ctx)
if err != nil {
return nil, err
}
return zones, nil
}
// Interface guards
var (
_ libdns.RecordGetter = (*Provider)(nil)
_ libdns.RecordAppender = (*Provider)(nil)
_ libdns.RecordSetter = (*Provider)(nil)
_ libdns.RecordDeleter = (*Provider)(nil)
_ libdns.ZoneLister = (*Provider)(nil)
)