Skip to content

Commit

Permalink
refactor: moved "filter" & "name" to const
Browse files Browse the repository at this point in the history
  • Loading branch information
belokobylskii.i committed Apr 2, 2024
1 parent f7270f0 commit 492a8aa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions internal/selprovider/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package selprovider
const (
domainsOptionLimit = "limit"
domainsOptionOffset = "offset"
domainsOptionFilter = "filter"
domainsOptionName = "name"

defaultDomainsLimit = "1000"
defaultDomainsOffset = "0"
Expand Down
2 changes: 1 addition & 1 deletion internal/selprovider/rrset_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (r *rrSetFetcher) getRRSetForUpdateDeletion(
}

domainRrSets, err := r.fetchRecords(ctx, client, resultZone.ID, map[string]string{
"name": change.DNSName,
domainsOptionName: change.DNSName,
})
if err != nil {
return nil, nil, err
Expand Down
2 changes: 1 addition & 1 deletion internal/selprovider/zone_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (z *zoneFetcher) zones(ctx context.Context, client domains.DNSClient[domain
// send one request per filter
for _, filter := range z.domainFilter.Filters {
zones, err := z.fetchZones(ctx, client, map[string]string{
"filter": filter,
domainsOptionFilter: filter,
})
if err != nil {
return nil, err
Expand Down

0 comments on commit 492a8aa

Please sign in to comment.