1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
package internal
import "fmt"
type APIResponse struct {
TransactID string `json:"transactid"`
Status string `json:"status"`
Message string `json:"message,omitempty"`
Code int `json:"code,omitempty"`
}
func (a APIResponse) Error() string {
return fmt.Sprintf("%s(%d): %s (%s)", a.Status, a.Code, a.Message, a.TransactID)
}
type ListResponse struct {
APIResponse
TotalRecords int `json:"total_records,omitempty"`
Records []Record `json:"records,omitempty"`
}
type Record struct {
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
TTL int `json:"ttl,omitempty"`
Type string `json:"type,omitempty"`
}
type RecordQuery struct {
FullRecordName string `url:"fullrecordname"`
Type string `url:"type"`
Value string `url:"value,omitempty"`
TTL int `url:"ttl,omitempty"`
}
type ListRecordQuery struct {
Domain string `url:"Domain"`
FilterType string `url:"FilterType,omitempty"`
}
|