-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(cloudflare): support comment
param
#980
Conversation
Co-authored-by: WaterLemons2k <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
再次感谢澄清。
Co-authored-by: WaterLemons2k <[email protected]>
zoneID := result.Result[0].ID | ||
|
||
var records CloudflareRecordsResp | ||
// getDomains 最多更新前50条 | ||
err = cf.request( | ||
"GET", | ||
fmt.Sprintf(zonesAPI+"/%s/dns_records?type=%s&name=%s&per_page=50", zoneID, recordType, domain), | ||
fmt.Sprintf(zonesAPI+"/%s/dns_records?type=%s&name=%s&per_page=50%s", zoneID, recordType, domain, comment), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`fmt.Sprintf(zonesAPI+"/%s/dns_records?type=%s&name=%s&per_page=50&comment=%s", zoneID, recordType, domain, domain.GetCustomParams().Get("comment")),`
上面那几行可以不要吧,一行搞定?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`fmt.Sprintf(zonesAPI+"/%s/dns_records?type=%s&name=%s&per_page=50&comment=%s", zoneID, recordType, domain, domain.GetCustomParams().Get("comment")),`
上面那几行可以不要吧,一行搞定?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
What does this PR do?
支持传递自定义参数
comment
来对 cloudflare 的 DNS 记录进行筛选,从而利用不同 comment 实现单域名多 IP 地址的效果Motivation
同#923,需要“单域名多 IP”的支持
Additional Notes
comment
参数未指定时,行为和原先一致:忽略 DNS 记录的 comment,只匹配域名,且不会修改 commentwww:example.cn.eu.org?comment=
.contains
等更高级的匹配模式,但对于“单域名多 IP”这一目标来说还用不到,因此暂未实现