File: types.go

package info (click to toggle)
golang-github-xenolf-lego 4.9.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,080 kB
  • sloc: xml: 533; makefile: 128; sh: 18
file content (40 lines) | stat: -rw-r--r-- 990 bytes parent folder | download | duplicates (2)
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"`
}