Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter separately in type and subname in records #1

Open
dergeberl opened this issue Feb 8, 2021 · 0 comments
Open

filter separately in type and subname in records #1

dergeberl opened this issue Feb 8, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@dergeberl
Copy link

dergeberl commented Feb 8, 2021

Thanks for the great library!

Do you think it is possible to adjust this filter section, to can filter on a subname and a type separately? For example this is needed to filter all A records over all subnames.

desec/records.go

Lines 49 to 54 in b4c3e4a

if filter != nil {
query := endpoint.Query()
query.Set("type", filter.Type)
query.Set("subname", filter.SubName)
endpoint.RawQuery = query.Encode()
}

My first idea was to check if the value of Type and SubName is not empty ("") before run query.Set(). But in case of SubName this will not work like expected because with the empty filter you find the records based on the basedomain.

desec/records.go

Lines 25 to 28 in b4c3e4a

type RRSetFilter struct {
Type string
SubName string
}

Maybe an idea is to set SubName (in RRSetFilter) to a pointer so it can be nil, and we can react in this to not set it as a filter.

@ldez ldez added the enhancement New feature or request label Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants