-
Notifications
You must be signed in to change notification settings - Fork 7
/
results.go
90 lines (81 loc) · 2.49 KB
/
results.go
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package domains
import (
"github.com/opentelekomcloud/gophertelekomcloud"
)
type Domain struct {
// Domain ID
Id string `json:"id"`
// Domain name
HostName string `json:"hostname"`
// Access Code
AccessCode string `json:"access_code"`
// CNAME value
Cname string `json:"cname"`
// TXT record
TxtCode string `json:"txt_code"`
// Sub Domain name
SubDomain string `json:"sub_domain"`
// Policy ID
PolicyID string `json:"policy_id"`
// WAF mode
ProtectStatus int `json:"protect_status"`
// Whether a domain name is connected to WAF
AccessStatus int `json:"access_status"`
// Protocol type
Protocol string `json:"protocol"`
// TLS version
TLS string `json:"tls"`
// Cipher suite
Cipher string `json:"cipher"`
// Certificate ID
CertificateId string `json:"certificate_id"`
// The original server information
Server []Server `json:"server"`
// Whether proxy is configured
Proxy bool `json:"proxy"`
// The type of the source IP header
SipHeaderName string `json:"sip_header_name"`
// The HTTP request header for identifying the real source IP.
SipHeaderList []string `json:"sip_header_list"`
// Alarm page configuration
BlockPage BlockPage `json:"block_page"`
}
type Server struct {
// Protocol type of the client
ClientProtocol string `json:"client_protocol" required:"true"`
// Protocol used by WAF to forward client requests to the server
ServerProtocol string `json:"server_protocol" required:"true"`
// IP address or domain name of the web server that the client accesses.
Address string `json:"address" required:"true"`
// Port number used by the web server
Port int `json:"port" required:"true"`
}
type commonResult struct {
golangsdk.Result
}
// Extract is a function that accepts a result and extracts a domain.
func (r commonResult) Extract() (*Domain, error) {
s := new(Domain)
err := r.ExtractIntoStructPtr(s, "")
return s, err
}
// CreateResult represents the result of a create operation. Call its Extract
// method to interpret it as a Domain.
type CreateResult struct {
commonResult
}
// UpdateResult represents the result of a update operation. Call its Extract
// method to interpret it as a Domain.
type UpdateResult struct {
commonResult
}
// GetResult represents the result of a get operation. Call its Extract
// method to interpret it as a Domain.
type GetResult struct {
commonResult
}
// DeleteResult represents the result of a delete operation. Call its ExtractErr
// method to determine if the request succeeded or failed.
type DeleteResult struct {
golangsdk.ErrResult
}