From 4d805ee9b28149d9e6faf301b430abf74cac36ae Mon Sep 17 00:00:00 2001 From: "honwen.chan" Date: Sat, 20 Jan 2024 01:00:22 +0800 Subject: [PATCH] bump deps, support of RR[@] --- .github/workflows/build.yaml | 3 +- alidns/AddDomainGroup_test.go | 25 -------- alidns/AddDomainRecord_test.go | 28 -------- alidns/AddDomain_test.go | 24 ------- alidns/ChangeDomainGroup_test.go | 36 ----------- alidns/DeleteDomainGroup_test.go | 23 ------- alidns/DeleteDomainRecord_test.go | 30 --------- alidns/DeleteDomain_test.go | 23 ------- alidns/DeleteSubDomainRecords_test.go | 31 --------- alidns/DescribeDomainGroups_test.go | 15 ----- alidns/DescribeDomainInfo_test.go | 17 ----- alidns/DescribeDomainRecordInfoNew_test.go | 30 --------- alidns/DescribeDomainRecordInfo_test.go | 30 --------- alidns/DescribeDomainRecordsNew_test.go | 21 ------ alidns/DescribeDomainRecords_test.go | 21 ------ alidns/DescribeDomains_test.go | 17 ----- alidns/DescribeSubDomainRecords_test.go | 20 ------ alidns/GetMainDomainName_test.go | 20 ------ alidns/UpdateDomainGroup_test.go | 23 ------- alidns/UpdateDomainRecord_test.go | 45 ------------- alidns/config_test.go | 37 ----------- alidns/record.go | 3 +- go.mod | 28 ++++---- go.sum | 74 ++++++++++++---------- main.go | 29 +++++++-- 25 files changed, 81 insertions(+), 572 deletions(-) delete mode 100644 alidns/AddDomainGroup_test.go delete mode 100644 alidns/AddDomainRecord_test.go delete mode 100644 alidns/AddDomain_test.go delete mode 100644 alidns/ChangeDomainGroup_test.go delete mode 100644 alidns/DeleteDomainGroup_test.go delete mode 100644 alidns/DeleteDomainRecord_test.go delete mode 100644 alidns/DeleteDomain_test.go delete mode 100644 alidns/DeleteSubDomainRecords_test.go delete mode 100644 alidns/DescribeDomainGroups_test.go delete mode 100644 alidns/DescribeDomainInfo_test.go delete mode 100644 alidns/DescribeDomainRecordInfoNew_test.go delete mode 100644 alidns/DescribeDomainRecordInfo_test.go delete mode 100644 alidns/DescribeDomainRecordsNew_test.go delete mode 100644 alidns/DescribeDomainRecords_test.go delete mode 100644 alidns/DescribeDomains_test.go delete mode 100644 alidns/DescribeSubDomainRecords_test.go delete mode 100644 alidns/GetMainDomainName_test.go delete mode 100644 alidns/UpdateDomainGroup_test.go delete mode 100644 alidns/UpdateDomainRecord_test.go delete mode 100644 alidns/config_test.go diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 86773ca..25ead8d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '1.21.5' + go-version: '1.21.6' - name: Prepare environment run: |- @@ -34,6 +34,7 @@ jobs: # Win - run: GOOS=windows GOARCH=386 VERSION=${RELEASE_VERSION} make release - run: GOOS=windows GOARCH=amd64 VERSION=${RELEASE_VERSION} make release + - run: GOOS=windows GOARCH=amd64 GOAMD64=v3 VERSION=${RELEASE_VERSION} make release - run: GOOS=windows GOARCH=arm64 VERSION=${RELEASE_VERSION} make release # MacOS diff --git a/alidns/AddDomainGroup_test.go b/alidns/AddDomainGroup_test.go deleted file mode 100644 index b6ee131..0000000 --- a/alidns/AddDomainGroup_test.go +++ /dev/null @@ -1,25 +0,0 @@ -package dns - -import ( - "testing" -) - -func TestAddDomainGroup(t *testing.T) { - client := NewTestClientNew() - args := AddDomainGroupArgs{ - GroupName: TestDomainGroupName, - } - - response, err := client.AddDomainGroup(&args) - if err == nil { - t.Logf("AddDomainGroup %s success, %v", TestDomainGroupName, response) - - deleteDomainGroupArgs := DeleteDomainGroupArgs{ - GroupId: response.GroupId, - } - client.DeleteDomainGroup(&deleteDomainGroupArgs) - - } else { - t.Errorf("Failed to AddDomainGroup, %v", err) - } -} diff --git a/alidns/AddDomainRecord_test.go b/alidns/AddDomainRecord_test.go deleted file mode 100644 index 00905ac..0000000 --- a/alidns/AddDomainRecord_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package dns - -import ( - "testing" -) - -func TestAddDomainRecord(t *testing.T) { - client := NewTestClient() - addDomainRecordArgs := AddDomainRecordArgs{ - DomainName: TestDomainName, - RR: "testaddrecord", - Type: ARecord, - Value: "8.8.8.8", - TTL: "600", - } - response, err := client.AddDomainRecord(&addDomainRecordArgs) - if err == nil { - t.Logf("AddDomainRecord: testaddr for domain: %s Success, %v", - TestDomainName, response) - - deleteDomainRecordArgs := DeleteDomainRecordArgs{ - RecordId: response.RecordId, - } - client.DeleteDomainRecord(&deleteDomainRecordArgs) - } else { - t.Errorf("Failed to AddDomainRecord: testaddr for domain: %s", TestDomainName) - } -} diff --git a/alidns/AddDomain_test.go b/alidns/AddDomain_test.go deleted file mode 100644 index 70b2a0f..0000000 --- a/alidns/AddDomain_test.go +++ /dev/null @@ -1,24 +0,0 @@ -package dns - -import ( - "testing" -) - -func TestAddDomain(t *testing.T) { - client := NewTestClientNew() - args := AddDomainArgs{ - DomainName: TestDomainName, - } - - if res, err := client.AddDomain(&args); err == nil { - t.Logf("AddDomain %s success, %v", TestDomainName, res) - - deleteDomainArgs := DeleteDomainArgs{ - DomainName: TestDomainName, - } - client.DeleteDomain(&deleteDomainArgs) - - } else { - t.Errorf("Failed to AddDomain, %v", err) - } -} diff --git a/alidns/ChangeDomainGroup_test.go b/alidns/ChangeDomainGroup_test.go deleted file mode 100644 index 05d316f..0000000 --- a/alidns/ChangeDomainGroup_test.go +++ /dev/null @@ -1,36 +0,0 @@ -package dns - -import "testing" - -func TestChangeDomainGroup(t *testing.T) { - client := NewTestClientNew() - - // create origin group - addGroupArgs := AddDomainGroupArgs{ - GroupName: TestDomainGroupName, - } - addGroupRes, _ := client.AddDomainGroup(&addGroupArgs) - - // add domain to origin group - addDomainArgs := AddDomainArgs{ - DomainName: TestDomainName, - GroupId: addGroupRes.GroupId, - } - addDomainRes, _ := client.AddDomain(&addDomainArgs) - - // create new group - addGroupArgs.GroupName = TestChanegGroupName - addGroupRes, _ = client.AddDomainGroup(&addGroupArgs) - - // change to new group - changeArgs := ChangeDomainGroupArgs{ - DomainName: addDomainRes.DomainName, - GroupId: addGroupRes.GroupId, - } - _, err := client.ChangeDomainGroup(&changeArgs) - if err == nil { - t.Logf("ChangeDomainGroup success") - } else { - t.Errorf("Failed to ChangeDomainGroup, %v", err) - } -} diff --git a/alidns/DeleteDomainGroup_test.go b/alidns/DeleteDomainGroup_test.go deleted file mode 100644 index f8ecb63..0000000 --- a/alidns/DeleteDomainGroup_test.go +++ /dev/null @@ -1,23 +0,0 @@ -package dns - -import ( - "testing" -) - -func TestDeleteDomainGroup(t *testing.T) { - client := NewTestClientNew() - args := AddDomainGroupArgs{ - GroupName: TestDomainGroupName, - } - res, _ := client.AddDomainGroup(&args) - - deleteDomainGroupArgs := DeleteDomainGroupArgs{ - GroupId: res.GroupId, - } - response, err := client.DeleteDomainGroup(&deleteDomainGroupArgs) - if err == nil { - t.Logf("DeleteDomainGroup %s success, %v", TestDomainGroupName, response) - } else { - t.Errorf("Failed to DeleteDomainGroup, %v", err) - } -} diff --git a/alidns/DeleteDomainRecord_test.go b/alidns/DeleteDomainRecord_test.go deleted file mode 100644 index 356c013..0000000 --- a/alidns/DeleteDomainRecord_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package dns - -import ( - "testing" -) - -func TestDeleteDomainRecord(t *testing.T) { - //prepare - client := NewTestClient() - addDomainRecordArgs := AddDomainRecordArgs{ - DomainName: TestDomainName, - RR: "testdeleterecordid", - Type: ARecord, - Value: "8.8.8.8", - TTL: "600", - } - - addResponse, err := client.AddDomainRecord(&addDomainRecordArgs) - - //test delete record - deleteDomainRecordArgs := DeleteDomainRecordArgs{ - RecordId: addResponse.RecordId, - } - deleteResponse, err := client.DeleteDomainRecord(&deleteDomainRecordArgs) - if err == nil { - t.Logf("DeleteDomainRecord: %v", deleteResponse) - } else { - t.Errorf("Failed to DeleteDomainRecord: %s", deleteDomainRecordArgs.RecordId) - } -} diff --git a/alidns/DeleteDomain_test.go b/alidns/DeleteDomain_test.go deleted file mode 100644 index 5c99f6d..0000000 --- a/alidns/DeleteDomain_test.go +++ /dev/null @@ -1,23 +0,0 @@ -package dns - -import ( - "testing" -) - -func TestDeleteDomain(t *testing.T) { - client := NewTestClientNew() - args := AddDomainArgs{ - DomainName: TestDomainName, - } - client.AddDomain(&args) - - deleteDomainArgs := DeleteDomainArgs{ - DomainName: TestDomainName, - } - response, err := client.DeleteDomain(&deleteDomainArgs) - if err == nil { - t.Logf("DeleteDomain %s success, %v", TestDomainName, response) - } else { - t.Errorf("Failed to DeleteDomain, %v", err) - } -} diff --git a/alidns/DeleteSubDomainRecords_test.go b/alidns/DeleteSubDomainRecords_test.go deleted file mode 100644 index a174a70..0000000 --- a/alidns/DeleteSubDomainRecords_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package dns - -import ( - "testing" -) - -func TestDeleteSubDomainRecords(t *testing.T) { - //prepare - client := NewTestClient() - addDomainRecordArgs := AddDomainRecordArgs{ - DomainName: TestDomainName, - RR: "testdeletesubdomainrecords", - Type: ARecord, - Value: "8.8.8.8", - TTL: "600", - } - - client.AddDomainRecord(&addDomainRecordArgs) - - //test delete subdomain - deleteDomainRecordArgs := DeleteSubDomainRecordsArgs{ - DomainName: TestDomainName, - RR: "testdeletesubdomainrecords", - } - deleteResponse, err := client.DeleteSubDomainRecords(&deleteDomainRecordArgs) - if err == nil { - t.Logf("DeleteDomainRecord: %v", deleteResponse) - } else { - t.Errorf("Failed to DeleteSubDomainRecords: %s", deleteDomainRecordArgs.RR) - } -} diff --git a/alidns/DescribeDomainGroups_test.go b/alidns/DescribeDomainGroups_test.go deleted file mode 100644 index 3e06a62..0000000 --- a/alidns/DescribeDomainGroups_test.go +++ /dev/null @@ -1,15 +0,0 @@ -package dns - -import "testing" - -func TestDescribeDomainGroups(t *testing.T) { - client := NewTestClientNew() - describeArgs := DescribeDomainGroupsArgs{} - - _, err := client.DescribeDomainGroups(&describeArgs) - if err == nil { - t.Logf("DescribeDomainGroups success") - } else { - t.Errorf("Failed to DescribeDomainGroups: %v", err) - } -} diff --git a/alidns/DescribeDomainInfo_test.go b/alidns/DescribeDomainInfo_test.go deleted file mode 100644 index 86fe175..0000000 --- a/alidns/DescribeDomainInfo_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package dns - -import "testing" - -func TestDescribeDomainInfo(t *testing.T) { - client := NewTestClientNew() - describeArgs := DescribeDomainInfoArgs{ - DomainName: TestDomainName, - } - - _, err := client.DescribeDomainInfo(&describeArgs) - if err == nil { - t.Logf("DescribeDomainInfo success") - } else { - t.Errorf("Failed to DescribeDomainInfo: %v", err) - } -} diff --git a/alidns/DescribeDomainRecordInfoNew_test.go b/alidns/DescribeDomainRecordInfoNew_test.go deleted file mode 100644 index 3d26ea2..0000000 --- a/alidns/DescribeDomainRecordInfoNew_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package dns - -import ( - "testing" -) - -func TestDescribeDomainRecordInfoNew(t *testing.T) { - //prepare - client := NewTestClientNew() - describeArgs := DescribeDomainRecordsNewArgs{ - DomainName: TestDomainName, - } - describeArgs.PageSize = 100 - - describeResponse, err := client.DescribeDomainRecordsNew(&describeArgs) - if err == nil { - record := describeResponse.DomainRecords.Record[0] - arg := DescribeDomainRecordInfoNewArgs{ - RecordId: record.RecordId, - } - response, err := client.DescribeDomainRecordInfoNew(&arg) - if err == nil { - t.Logf("DescribeDomainRecordInfo success: %v", response) - } else { - t.Errorf("Failed to DescribeDomainRecordInfo: %s", describeArgs.DomainName) - } - } else { - t.Errorf("Failed to DescribeDomainRecords: %s", describeArgs.DomainName) - } -} diff --git a/alidns/DescribeDomainRecordInfo_test.go b/alidns/DescribeDomainRecordInfo_test.go deleted file mode 100644 index 4741fee..0000000 --- a/alidns/DescribeDomainRecordInfo_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package dns - -import ( - "testing" -) - -func TestDescribeDomainRecordInfo(t *testing.T) { - //prepare - client := NewTestClient() - describeArgs := DescribeDomainRecordsArgs{ - DomainName: TestDomainName, - } - describeArgs.PageSize = 100 - - describeResponse, err := client.DescribeDomainRecords(&describeArgs) - if err == nil { - record := describeResponse.DomainRecords.Record[0] - arg := DescribeDomainRecordInfoArgs{ - RecordId: record.RecordId, - } - response, err := client.DescribeDomainRecordInfo(&arg) - if err == nil { - t.Logf("DescribeDomainRecordInfo success: %v", response) - } else { - t.Errorf("Failed to DescribeDomainRecordInfo: %s", describeArgs.DomainName) - } - } else { - t.Errorf("Failed to DescribeDomainRecords: %s", describeArgs.DomainName) - } -} diff --git a/alidns/DescribeDomainRecordsNew_test.go b/alidns/DescribeDomainRecordsNew_test.go deleted file mode 100644 index 96818a0..0000000 --- a/alidns/DescribeDomainRecordsNew_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package dns - -import ( - "testing" -) - -func TestDescribeDomainRecordsNew(t *testing.T) { - //prepare - client := NewTestClientNew() - describeArgs := DescribeDomainRecordsNewArgs{ - DomainName: TestDomainName, - } - describeArgs.PageSize = 100 - - describeResponse, err := client.DescribeDomainRecordsNew(&describeArgs) - if err == nil { - t.Logf("DescribeDomainRecords success: TotalCount:%d ", describeResponse.TotalCount) - } else { - t.Errorf("Failed to DescribeDomainRecords: %s", describeArgs.DomainName) - } -} diff --git a/alidns/DescribeDomainRecords_test.go b/alidns/DescribeDomainRecords_test.go deleted file mode 100644 index 45e5a34..0000000 --- a/alidns/DescribeDomainRecords_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package dns - -import ( - "testing" -) - -func TestDescribeDomainRecords(t *testing.T) { - //prepare - client := NewTestClient() - describeArgs := DescribeDomainRecordsArgs{ - DomainName: TestDomainName, - } - describeArgs.PageSize = 100 - - describeResponse, err := client.DescribeDomainRecords(&describeArgs) - if err == nil { - t.Logf("DescribeDomainRecords success: TotalCount:%d ", describeResponse.TotalCount) - } else { - t.Errorf("Failed to DescribeDomainRecords: %s", describeArgs.DomainName) - } -} diff --git a/alidns/DescribeDomains_test.go b/alidns/DescribeDomains_test.go deleted file mode 100644 index 7a8a373..0000000 --- a/alidns/DescribeDomains_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package dns - -import "testing" - -func TestDescribeDomains(t *testing.T) { - client := NewTestClientNew() - describeArgs := DescribeDomainInfoArgs{ - DomainName: TestDomainName, - } - - _, err := client.DescribeDomainInfo(&describeArgs) - if err == nil { - t.Logf("DescribeDomains success") - } else { - t.Errorf("Failed to DescribeDomains: %v", err) - } -} diff --git a/alidns/DescribeSubDomainRecords_test.go b/alidns/DescribeSubDomainRecords_test.go deleted file mode 100644 index c4cbf27..0000000 --- a/alidns/DescribeSubDomainRecords_test.go +++ /dev/null @@ -1,20 +0,0 @@ -package dns - -import ( - "testing" -) - -func TestDescribeSubDomainRecords(t *testing.T) { - //prepare - client := NewTestClient() - describeArgs := DescribeSubDomainRecordsArgs{ - SubDomain: "go." + TestDomainName, - } - - describeResponse, err := client.DescribeSubDomainRecords(&describeArgs) - if err == nil { - t.Logf("DescribeSubDomainRecords success: %v ", describeResponse) - } else { - t.Errorf("Failed to DescribeSubDomainRecords: %s", describeArgs.SubDomain) - } -} diff --git a/alidns/GetMainDomainName_test.go b/alidns/GetMainDomainName_test.go deleted file mode 100644 index f35ba70..0000000 --- a/alidns/GetMainDomainName_test.go +++ /dev/null @@ -1,20 +0,0 @@ -package dns - -import ( - "testing" -) - -func TestGetMainDomainName(t *testing.T) { - //prepare - client := NewTestClient() - args := GetMainDomainNameArgs{ - InputString: "go." + TestDomainName, - } - - resp, err := client.GetMainDomainName(&args) - if err == nil { - t.Logf("GetMainDomainName success: %v ", resp) - } else { - t.Errorf("Failed to GetMainDomainName: %s", args.InputString) - } -} diff --git a/alidns/UpdateDomainGroup_test.go b/alidns/UpdateDomainGroup_test.go deleted file mode 100644 index 85ded4c..0000000 --- a/alidns/UpdateDomainGroup_test.go +++ /dev/null @@ -1,23 +0,0 @@ -package dns - -import "testing" - -func TestUpdateDomainGroup(t *testing.T) { - client := NewTestClientNew() - - addGroupArgs := AddDomainGroupArgs{ - GroupName: TestDomainGroupName, - } - addGroupRes, _ := client.AddDomainGroup(&addGroupArgs) - - updateArgs := UpdateDomainGroupArgs{ - GroupId: addGroupRes.GroupId, - GroupName: TestChanegGroupName, - } - _, err := client.UpdateDomainGroup(&updateArgs) - if err == nil { - t.Logf("UpdateDomainGroup success") - } else { - t.Errorf("Failed to UpdateDomainGroup, %v", err) - } -} diff --git a/alidns/UpdateDomainRecord_test.go b/alidns/UpdateDomainRecord_test.go deleted file mode 100644 index 206e341..0000000 --- a/alidns/UpdateDomainRecord_test.go +++ /dev/null @@ -1,45 +0,0 @@ -package dns - -import ( - "testing" -) - -func TestUpdateDomainRecord(t *testing.T) { - //prepare - client := NewTestClient() - addDomainRecordArgs := AddDomainRecordArgs{ - DomainName: TestDomainName, - RR: "testupdaterecordid", - Value: "8.8.8.8", - Type: ARecord, - TTL: "600", - } - - addResponse, err := client.AddDomainRecord(&addDomainRecordArgs) - - // test update record - updateArgs := UpdateDomainRecordArgs{ - RecordId: addResponse.RecordId, - RR: addDomainRecordArgs.RR, - Value: "4.4.4.4", - Type: ARecord, - TTL: "600", - } - - _, err = client.UpdateDomainRecord(&updateArgs) - if err == nil { - t.Logf("UpdateDomainRecord success: RR:%s Value:%s", updateArgs.RR, updateArgs.Value) - } else { - t.Errorf("Failed to UpdateDomainRecord: %s", updateArgs.RecordId) - } - - //clearup - deleteDomainRecordArgs := DeleteDomainRecordArgs{ - RecordId: addResponse.RecordId, - } - _, err = client.DeleteDomainRecord(&deleteDomainRecordArgs) - if err != nil { - t.Errorf("Failed to DeleteDomainRecord: %s", deleteDomainRecordArgs.RecordId) - } - -} diff --git a/alidns/config_test.go b/alidns/config_test.go deleted file mode 100644 index 117c255..0000000 --- a/alidns/config_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package dns - -//Modify with your Access Key Id and Access Key Secret -const ( - TestAccessKeyId = "MY_ACCESS_KEY_ID" - TestAccessKeySecret = "MY_ACCESS_KEY_SECRET" - TestDomainName = "aisafe.win" - TestDomainGroupName = "testgroup" - TestChanegGroupName = "testchangegroup" -) - -var testClient *Client - -func NewTestClient() *Client { - if testClient == nil { - testClient = NewClient(TestAccessKeyId, TestAccessKeySecret) - } - return testClient -} - -// change DNSDefaultEndpoint to "http://alidns.aliyuncs.com" -func NewTestClientNew() *Client { - if testClient == nil { - testClient = NewClientNew(TestAccessKeyId, TestAccessKeySecret) - } - return testClient -} - -var testDebugClient *Client - -func NewTestClientForDebug() *Client { - if testDebugClient == nil { - testDebugClient = NewClient(TestAccessKeyId, TestAccessKeySecret) - testDebugClient.SetDebug(true) - } - return testDebugClient -} diff --git a/alidns/record.go b/alidns/record.go index 7b5551a..8d10a40 100644 --- a/alidns/record.go +++ b/alidns/record.go @@ -2,8 +2,7 @@ package dns import "encoding/json" -// -//you can read doc at https://docs.aliyun.com/#/pub/dns/api-reference/enum-type&record-format +// you can read doc at https://docs.aliyun.com/#/pub/dns/api-reference/enum-type&record-format const ( ARecord = "A" NSRecord = "NS" diff --git a/go.mod b/go.mod index 327bd18..5683ba9 100644 --- a/go.mod +++ b/go.mod @@ -2,44 +2,42 @@ module github.com/honwen/aliyun-ddns-cli go 1.21 -toolchain go1.21.4 - require ( // locked before tracing/logging https://github.com/denverdino/aliyungo/commits/master/go.mod github.com/denverdino/aliyungo v0.0.0-20220321085828-46dabbd9e212 github.com/honwen/golibs v0.5.1 - github.com/honwen/ip2loc v0.3.2 + github.com/honwen/ip2loc v0.3.4 github.com/urfave/cli v1.22.14 - github.com/ysmood/got v0.38.2 + github.com/ysmood/got v0.39.4 ) require ( - github.com/AdguardTeam/golibs v0.18.1 // indirect + github.com/AdguardTeam/golibs v0.18.2 // indirect github.com/PuerkitoBio/goquery v1.8.1 // indirect github.com/Workiva/go-datastructures v1.1.1 // indirect github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635 // indirect github.com/ameshkov/dnscrypt/v2 v2.2.7 // indirect github.com/ameshkov/dnsstamps v1.0.3 // indirect - github.com/andybalholm/cascadia v1.3.1 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/andybalholm/cascadia v1.3.2 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect - github.com/google/pprof v0.0.0-20230926050212-f7f687d19a98 // indirect + github.com/google/pprof v0.0.0-20231229205709-960ae82b1e42 // indirect github.com/miekg/dns v1.1.57 // indirect github.com/mr-karan/doggo v0.5.8-0.20231106042340-371f014c79e3 // indirect - github.com/onsi/ginkgo/v2 v2.13.0 // indirect + github.com/onsi/ginkgo/v2 v2.13.2 // indirect github.com/quic-go/qtls-go1-20 v0.4.1 // indirect - github.com/quic-go/quic-go v0.40.0 // indirect + github.com/quic-go/quic-go v0.40.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/tidwall/pretty v1.2.1 // indirect github.com/ysmood/gop v0.2.0 // indirect - go.uber.org/mock v0.3.0 // indirect - golang.org/x/crypto v0.16.0 // indirect - golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect - golang.org/x/mod v0.13.0 // indirect + go.uber.org/mock v0.4.0 // indirect + golang.org/x/crypto v0.17.0 // indirect + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect + golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.14.0 // indirect + golang.org/x/tools v0.16.1 // indirect ) diff --git a/go.sum b/go.sum index f7fe84c..eb55a68 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/AdguardTeam/golibs v0.18.1 h1:6u0fvrIj2qjUsRdbIGJ9AR0g5QRSWdKIo/DYl3tp5aM= -github.com/AdguardTeam/golibs v0.18.1/go.mod h1:DKhCIXHcUYtBhU8ibTLKh1paUL96n5zhQBlx763sj+U= +github.com/AdguardTeam/golibs v0.18.2 h1:fI5Kw5tnIXLmiT/oiZrSpudl88aW3IeLMG4JpEH/5Gs= +github.com/AdguardTeam/golibs v0.18.2/go.mod h1:3WunclLLfrVAq7fYQRhd6f168FHOEMssnipVXCxDL/w= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM= github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ= @@ -13,44 +13,46 @@ github.com/ameshkov/dnscrypt/v2 v2.2.7 h1:aEitLIR8HcxVodZ79mgRcCiC0A0I5kZPBuWGFw github.com/ameshkov/dnscrypt/v2 v2.2.7/go.mod h1:qPWhwz6FdSmuK7W4sMyvogrez4MWdtzosdqlr0Rg3ow= github.com/ameshkov/dnsstamps v1.0.3 h1:Srzik+J9mivH1alRACTbys2xOxs0lRH9qnTA7Y1OYVo= github.com/ameshkov/dnsstamps v1.0.3/go.mod h1:Ii3eUu73dx4Vw5O4wjzmT5+lkCwovjzaEZZ4gKyIH5A= -github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= +github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss= +github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/denverdino/aliyungo v0.0.0-20220321085828-46dabbd9e212 h1:B2Rxw68ocMMmFKovK+QZsxHijiwDFRdjNRYERR5U75A= github.com/denverdino/aliyungo v0.0.0-20220321085828-46dabbd9e212/go.mod h1:VVxx1gyGhdt369208nKOYLI0PVgrZqbU+EuWBZJQ1ZQ= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/pprof v0.0.0-20230926050212-f7f687d19a98 h1:pUa4ghanp6q4IJHwE9RwLgmVFfReJN+KbQ8ExNEUUoQ= -github.com/google/pprof v0.0.0-20230926050212-f7f687d19a98/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/pprof v0.0.0-20231229205709-960ae82b1e42 h1:dHLYa5D8/Ta0aLR2XcPsrkpAgGeFs6thhMcQK0oQ0n8= +github.com/google/pprof v0.0.0-20231229205709-960ae82b1e42/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= github.com/honwen/golibs v0.5.1 h1:4GLXoeNgB3ZPLJFIF5IqO77fJZMsFUhARLK/FFxwX4w= github.com/honwen/golibs v0.5.1/go.mod h1:K/kortXX+JS66qG06ktUVM/jQuFpIajgaBCEDzefJqw= -github.com/honwen/ip2loc v0.3.2 h1:AQF43DffLDKSa3sMhHeUCRvV7jUy64KAcgYSdXm5t3E= -github.com/honwen/ip2loc v0.3.2/go.mod h1:Kn5+kHURKTmuBsH9uXbnjZZGUh4ihyuzXtxq1OYAG0I= +github.com/honwen/ip2loc v0.3.4 h1:bK0vmSMMTs6TtbF5FsVLCVDRA1QJgkYnUlkehvw3grU= +github.com/honwen/ip2loc v0.3.4/go.mod h1:x58tZxV15jrQPm8FiCyYy1YpIS37KSmC822WkDgid9Q= github.com/miekg/dns v1.1.57 h1:Jzi7ApEIzwEPLHWRcafCN9LZSBbqQpxjt/wpgvg7wcM= github.com/miekg/dns v1.1.57/go.mod h1:uqRjCRUuEAA6qsOiJvDd+CFo/vW+y5WR6SNmHE55hZk= github.com/mr-karan/doggo v0.5.8-0.20231106042340-371f014c79e3 h1:TvKWVbVZxlg9Pfj50ocWOMgiTkB/Q4wi8n2mEjclgDg= github.com/mr-karan/doggo v0.5.8-0.20231106042340-371f014c79e3/go.mod h1:Zh7KaE3J8wGVglVRqCQssQLQv1R18PSKsjJ874Jz508= -github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= -github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= +github.com/onsi/ginkgo/v2 v2.13.2 h1:Bi2gGVkfn6gQcjNjZJVO8Gf0FHzMPf2phUei9tejVMs= +github.com/onsi/ginkgo/v2 v2.13.2/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM= +github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= +github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/quic-go/qtls-go1-20 v0.4.1 h1:D33340mCNDAIKBqXuAvexTNMUByrYmFYVfKfDN5nfFs= github.com/quic-go/qtls-go1-20 v0.4.1/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k= -github.com/quic-go/quic-go v0.40.0 h1:GYd1iznlKm7dpHD7pOVpUvItgMPo/jrMgDWZhMCecqw= -github.com/quic-go/quic-go v0.40.0/go.mod h1:PeN7kuVJ4xZbxSv/4OX6S1USOX8MJvydwpTx31vx60c= +github.com/quic-go/quic-go v0.40.1 h1:X3AGzUNFs0jVuO3esAGnTfvdgvL4fq655WaOi1snv1Q= +github.com/quic-go/quic-go v0.40.1/go.mod h1:PeN7kuVJ4xZbxSv/4OX6S1USOX8MJvydwpTx31vx60c= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= @@ -72,38 +74,42 @@ github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk= github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA= github.com/ysmood/gop v0.2.0 h1:+tFrG0TWPxT6p9ZaZs+VY+opCvHU8/3Fk6BaNv6kqKg= github.com/ysmood/gop v0.2.0/go.mod h1:rr5z2z27oGEbyB787hpEcx4ab8cCiPnKxn0SUHt6xzk= -github.com/ysmood/got v0.38.2 h1:h2RYvAe5nIK+oBRMLzNIrkZaX5kjmkOBqfRMIsFzLyU= -github.com/ysmood/got v0.38.2/go.mod h1:W7DdpuX6skL3NszLmAsC5hT7JAhuLZhByVzHTq874Qg= +github.com/ysmood/got v0.39.4 h1:8ru7J25Zmf/sMTNYOF2172xVkjQrPMJ3R5d6uymoqL8= +github.com/ysmood/got v0.39.4/go.mod h1:W7DdpuX6skL3NszLmAsC5hT7JAhuLZhByVzHTq874Qg= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo= -go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= -golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= -golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= -golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -114,24 +120,28 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= -golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= +golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/main.go b/main.go index be28061..2971a27 100644 --- a/main.go +++ b/main.go @@ -22,6 +22,8 @@ import ( "github.com/urfave/cli" ) +const RR_AT = `@` + // AccessKey from https://ak-console.aliyun.com/#/accesskey type AccessKey struct { ID string @@ -61,6 +63,17 @@ func (ak *AccessKey) ListManagedDomains() (domains []string, err error) { return } +func (ak *AccessKey) SplitDomainToRR(fulldomain string) (r, d string) { + if r, d, err := accessKey.AutocheckDomainRR("", fulldomain); err == nil { + if len(r) == 0 { + r = RR_AT + } + return r, d + } else { + return domain.SplitDomainToRR(fulldomain) + } +} + func (ak *AccessKey) AutocheckDomainRR(rr, domain string) (r, d string, err error) { if contains(ak.managedDomains, domain) { return rr, domain, nil @@ -189,8 +202,12 @@ var ( VersionString = "MISSING build version [git hash]" ) -func init() { - rand.Seed(time.Now().UnixNano()) +func joinDomain(rr, domain string) string { + if rr == RR_AT { + return domain + } else { + return rr + `.` + domain + } } func main() { @@ -228,7 +245,7 @@ func main() { fmt.Printf("%+v", err) } else { for _, v := range dnsRecords { - fmt.Printf("%20s %-16s %s\n", v.RR+`.`+v.DomainName, fmt.Sprintf("%s(TTL:%4s)", v.Type, v.TTL), v.Value) + fmt.Printf("%20s %-16s %s\n", joinDomain(v.RR, v.DomainName), fmt.Sprintf("%s(TTL:%4s)", v.Type, v.TTL), v.Value) } } return nil @@ -249,7 +266,7 @@ func main() { return err } // fmt.Println(c.Command.Name, "task: ", accessKey, c.String("domain")) - rr, domain, err := accessKey.AutocheckDomainRR(domain.SplitDomainToRR(c.String("domain"))) + rr, domain, err := accessKey.AutocheckDomainRR(accessKey.SplitDomainToRR(c.String("domain"))) if err != nil { return err } @@ -285,7 +302,7 @@ func main() { return err } // fmt.Println(c.Command.Name, "task: ", accessKey, c.String("domain"), c.String("ipaddr")) - rr, domain, err := accessKey.AutocheckDomainRR(domain.SplitDomainToRR(c.String("domain"))) + rr, domain, err := accessKey.AutocheckDomainRR(accessKey.SplitDomainToRR(c.String("domain"))) if err != nil { return err } @@ -326,7 +343,7 @@ func main() { return err } // fmt.Println(c.Command.Name, "task: ", accessKey, c.String("domain"), c.Int64("redo")) - rr, domain, err := accessKey.AutocheckDomainRR(domain.SplitDomainToRR(c.String("domain"))) + rr, domain, err := accessKey.AutocheckDomainRR(accessKey.SplitDomainToRR(c.String("domain"))) if err != nil { return err }