mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-28 08:26:36 +08:00
域名解析增加CloudFlare DNS支持
This commit is contained in:
22
internal/dnsclients/cloudflare/response_base.go
Normal file
22
internal/dnsclients/cloudflare/response_base.go
Normal file
@@ -0,0 +1,22 @@
|
||||
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
||||
|
||||
package cloudflare
|
||||
|
||||
type BaseResponse struct {
|
||||
Success bool `json:"success"`
|
||||
Errors []struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
} `json:"errors"`
|
||||
}
|
||||
|
||||
func (this *BaseResponse) IsOk() bool {
|
||||
return this.Success
|
||||
}
|
||||
|
||||
func (this *BaseResponse) LastError() (code int, message string) {
|
||||
if len(this.Errors) == 0 {
|
||||
return 0, ""
|
||||
}
|
||||
return this.Errors[0].Code, this.Errors[0].Message
|
||||
}
|
||||
Reference in New Issue
Block a user