@@ -10,20 +10,19 @@ import (
1010)
1111
1212const (
13- AccessKeyId = "*"
14- AccessKeySecret = "*"
15- )
13+ AccessKeyId = ""
14+ AccessKeySecret = ""
1615
17- func main () {
18- client , err := api .CreateClient (AccessKeyId , AccessKeySecret )
19- if err != nil {
20- panic (err )
21- }
16+ Domain = "home.c8g.top"
17+ RR = "@"
18+ Type = "AAAA"
19+ )
2220
21+ func Describe (client * alidns20150109.Client ) {
2322 describeDomainRecordsRequest := & alidns20150109.DescribeDomainRecordsRequest {
24- DomainName : tea .String ("home.c8g.top" ),
25- RRKeyWord : tea .String ("@" ),
26- TypeKeyWord : tea .String ("A" ),
23+ DomainName : tea .String (Domain ),
24+ RRKeyWord : tea .String (RR ),
25+ Type : tea .String (Type ),
2726 }
2827 resp , err := client .DescribeDomainRecords (describeDomainRecordsRequest )
2928 if err != nil {
@@ -37,3 +36,27 @@ func main() {
3736
3837 fmt .Println ("resp" , string (respBytes ))
3938}
39+
40+ func Find (client * alidns20150109.Client ) {
41+ rec , err := api .FindRecord (client , Domain , RR , Type )
42+ if err != nil {
43+ panic (err )
44+ }
45+ recBytes , err := json .MarshalIndent (rec , "" , " " )
46+ if err != nil {
47+ panic (err )
48+ }
49+
50+ fmt .Println ("rec" , string (recBytes ))
51+ }
52+
53+ func main () {
54+ client , err := api .CreateClient (AccessKeyId , AccessKeySecret )
55+ if err != nil {
56+ panic (err )
57+ }
58+
59+ Describe (client )
60+
61+ Find (client )
62+ }
0 commit comments