Skip to content

Commit

Permalink
Merge pull request #3 from eryajf/feat_domain_info
Browse files Browse the repository at this point in the history
将公用工具移动到public目录,增加域名创建及到期日期的字段
  • Loading branch information
eryajf authored Sep 1, 2024
2 parents 5e064b3 + 673e627 commit 52e799c
Show file tree
Hide file tree
Showing 12 changed files with 179 additions and 46 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ domain_list{
domain_name="域名",
domain_remark="域名备注",
domain_status="域名状态",
create_time="域名创建时间"} 0
create_data="域名创建日期",
create_data="域名到期日期"} 99 (此value为域名距离到期的天数)
<!-- 域名记录列表 -->
record_list{
Expand Down
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ toolchain go1.22.4
require (
github.com/alibabacloud-go/alidns-20150109/v4 v4.5.5
github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.9
github.com/alibabacloud-go/domain-20180129/v4 v4.2.0
github.com/alibabacloud-go/tea v1.2.2
github.com/allegro/bigcache/v3 v3.1.0
github.com/charmbracelet/log v0.2.2
github.com/golang-module/carbon/v2 v2.3.12
github.com/prometheus/client_golang v1.16.0
github.com/robfig/cron/v3 v3.0.1
github.com/spf13/cobra v1.8.1
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.989
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.993
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.989
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/domain v1.0.993
)

require (
Expand Down
20 changes: 17 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.9/go.mod h1:bb+Io8Sn2RuM3/R
github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68/go.mod h1:6pb/Qy8c+lqua8cFpEy7g39NRRqOWc3rOwAy8m5Y2BY=
github.com/alibabacloud-go/debug v1.0.0 h1:3eIEQWfay1fB24PQIEzXAswlVJtdQok8f3EVN5VrBnA=
github.com/alibabacloud-go/debug v1.0.0/go.mod h1:8gfgZCCAC3+SCzjWtY053FrOcd4/qlH6IHTI4QyICOc=
github.com/alibabacloud-go/domain-20180129/v4 v4.2.0 h1:PAEt76VDoXbQODWeN9PTwYhA5NoEbJSK/yzGX2DZXrQ=
github.com/alibabacloud-go/domain-20180129/v4 v4.2.0/go.mod h1:q0n3wgGRndhuZsAXFVCFtiSR8+W0so85qYtKLzR2b18=
github.com/alibabacloud-go/endpoint-util v1.1.0 h1:r/4D3VSw888XGaeNpP994zDUaxdgTSHBbVfZlzf6b5Q=
github.com/alibabacloud-go/endpoint-util v1.1.0/go.mod h1:O5FuCALmCKs2Ff7JFJMudHs0I5EBgecXXxZRyswlEjE=
github.com/alibabacloud-go/openapi-util v0.1.0 h1:0z75cIULkDrdEhkLWgi9tnLe+KhAFE/r5Pb3312/eAY=
Expand Down Expand Up @@ -48,6 +50,8 @@ 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/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4=
github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/golang-module/carbon/v2 v2.3.12 h1:VC1DwN1kBwJkh5MjXmTFryjs5g4CWyoM8HAHffZPX/k=
github.com/golang-module/carbon/v2 v2.3.12/go.mod h1:HNsedGzXGuNciZImYP2OMnpiwq/vhIstR/vn45ib5cI=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
Expand Down Expand Up @@ -119,14 +123,23 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.989 h1:jqwrVW8ZkPSAsGnpF9lLotmrkNunbC0cKrrTZRPksFY=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.989/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.993 h1:+iJMmF0q1MPyhLs0+J7CcJ47w/vq6ICsCxnV4gc0dKw=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.993/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.989 h1:EK4u1YQBGhgvZU0DeJEGX1oWEP/Gigq7sEwLdZBZLyA=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.989/go.mod h1:pPFLkcTX4Z+Exqd6dAQueimkvniIHzqUvvaf6o9uaa8=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/domain v1.0.993 h1:v/L8pM1EjEhHudA6B/LduXN87QpoFZ5kgfpLcsMpLQs=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/domain v1.0.993/go.mod h1:fRBKEOc+KFiglAiIHIozQiveI6O+unpw0qL95iunZxA=
github.com/tjfoc/gmsm v1.3.2 h1:7JVkAn5bvUJ7HtU08iW6UiD+UTmJTIToHCfeFzkcCxM=
github.com/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down Expand Up @@ -215,5 +228,6 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
6 changes: 4 additions & 2 deletions pkg/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import (
"runtime"

"github.com/eryajf/cloud_dns_exporter/pkg/export"
"github.com/eryajf/cloud_dns_exporter/pkg/logger"
"github.com/eryajf/cloud_dns_exporter/public/logger"

"github.com/eryajf/cloud_dns_exporter/public"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
Expand Down Expand Up @@ -63,7 +64,8 @@ func RunServer() {
<body>
<h1>Cloud DNS Exporter</h1>
<p><a href='/metrics'>Metrics</a></p>
<p><a href='https://github.com/eryajf'>By Eryajf</a></p>
<p><a href='https://github.com/eryajf/cloud_dns_exporter'>Source Repo</a></p>
<p><a href='https://github.com/eryajf'>Create By Eryajf</a></p>
</body>
</html>`))
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion pkg/export/cron_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import (
"fmt"
"sync"

"github.com/eryajf/cloud_dns_exporter/pkg/logger"
"github.com/eryajf/cloud_dns_exporter/public/logger"

"github.com/eryajf/cloud_dns_exporter/pkg/provider"
"github.com/eryajf/cloud_dns_exporter/public"
"github.com/robfig/cron/v3"
Expand Down
8 changes: 5 additions & 3 deletions pkg/export/export_gauge.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import (
"fmt"
"sync"

"github.com/eryajf/cloud_dns_exporter/pkg/logger"
"github.com/eryajf/cloud_dns_exporter/public/logger"

"github.com/eryajf/cloud_dns_exporter/pkg/provider"
"github.com/eryajf/cloud_dns_exporter/public"
"github.com/prometheus/client_golang/prometheus"
Expand Down Expand Up @@ -40,7 +41,8 @@ func NewMetrics(namespace string) *Metrics {
"domain_name",
"domain_remark",
"domain_status",
"create_time",
"created_date",
"expiry_date",
}),
public.RecordList: newGlobalMetric(namespace,
public.RecordList,
Expand Down Expand Up @@ -113,7 +115,7 @@ func (c *Metrics) Collect(ch chan<- prometheus.Metric) {
}
for _, v := range domains {
ch <- prometheus.MustNewConstMetric(
c.metrics[public.DomainList], prometheus.GaugeValue, 1, v.CloudProvider, v.CloudName, v.DomainID, v.DomainName, v.DomainRemark, v.DomainStatus, v.CreateTime)
c.metrics[public.DomainList], prometheus.GaugeValue, float64(v.DaysUntilExpiry), v.CloudProvider, v.CloudName, v.DomainID, v.DomainName, v.DomainRemark, v.DomainStatus, v.CreatedDate, v.ExpiryDate)
}
// get record list from cache
recordListCacheKey := public.RecordList + "_" + cloudProvider + "_" + cloudName
Expand Down
76 changes: 66 additions & 10 deletions pkg/provider/aliyun.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import (

alidns "github.com/alibabacloud-go/alidns-20150109/v4/client"
openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
domain "github.com/alibabacloud-go/domain-20180129/v4/client"
"github.com/alibabacloud-go/tea/tea"
"github.com/golang-module/carbon/v2"

"github.com/eryajf/cloud_dns_exporter/public/logger"

"github.com/eryajf/cloud_dns_exporter/pkg/logger"
"github.com/eryajf/cloud_dns_exporter/pkg/tools"
"github.com/eryajf/cloud_dns_exporter/public"
)

Expand Down Expand Up @@ -64,15 +66,22 @@ func (a *AliyunDNS) ListDomains() ([]Domain, error) {
if err != nil {
return nil, err
}
domainNames, err := a.getDomainNameList()
if err != nil {
return nil, err
}
for _, v := range domains {
domainCreateAndExpiryDate := a.getDomainCreateAndExpiryDate(domainNames, v)
dataObj = append(dataObj, Domain{
CloudProvider: a.account.CloudProvider,
CloudName: a.account.CloudName,
DomainID: tea.StringValue(v.DomainId),
DomainName: tea.StringValue(v.DomainName),
DomainRemark: tea.StringValue(v.Remark),
DomainStatus: "enable",
CreateTime: tea.StringValue(v.CreateTime),
CloudProvider: a.account.CloudProvider,
CloudName: a.account.CloudName,
DomainID: tea.StringValue(v.DomainId),
DomainName: tea.StringValue(v.DomainName),
DomainRemark: tea.StringValue(v.Remark),
DomainStatus: "enable",
CreatedDate: domainCreateAndExpiryDate.CreatedDate,
ExpiryDate: domainCreateAndExpiryDate.ExpiryDate,
DaysUntilExpiry: domainCreateAndExpiryDate.DaysUntilExpiry,
})
}
return dataObj, nil
Expand Down Expand Up @@ -135,7 +144,7 @@ func (a *AliyunDNS) ListRecords() ([]Record, error) {
RecordWeight: fmt.Sprintf("%d", tea.Int32Value(v.Weight)),
RecordStatus: oneStatus(tea.StringValue(v.Status)),
RecordRemark: tea.StringValue(v.Remark),
UpdateTime: tools.GetReadTimeMs(tea.Int64Value(v.UpdateTimestamp)),
UpdateTime: carbon.CreateFromTimestampMilli(tea.Int64Value(v.UpdateTimestamp)).ToDateTimeString(),
FullRecord: tea.StringValue(v.RR) + "." + domain,
})
}
Expand Down Expand Up @@ -189,3 +198,50 @@ func (a *AliyunDNS) getRecordList(domain string) (rst []*alidns.DescribeDomainRe
}
return
}

// https://next.api.aliyun.com/document/Domain/2018-01-29/QueryDomainList
// getDomainNameList 获取域名列表
func (a *AliyunDNS) getDomainNameList() (rst []*domain.QueryDomainListResponseBodyDataDomain, err error) {
config := openapi.Config{
AccessKeyId: tea.String(a.account.SecretID),
AccessKeySecret: tea.String(a.account.SecretKey),
}
config.Endpoint = tea.String("domain.aliyuncs.com")
client, err := domain.NewClient(&config)
if err != nil {
return nil, err
}
var (
pageNumber int32 = 1
pageSize int32 = 500
)
for {
resp, err := client.QueryDomainList(&domain.QueryDomainListRequest{
PageNum: tea.Int32(pageNumber),
PageSize: tea.Int32(pageSize),
})
if err != nil {
return nil, err
}
rst = append(rst, resp.Body.Data.Domain...)
if len(resp.Body.Data.Domain) < int(pageSize) {
break
}
pageNumber++
}
return
}

// getDomainCreateAndExpiryDate 获取域名的创建时间与到期时间
func (a *AliyunDNS) getDomainCreateAndExpiryDate(domainList []*domain.QueryDomainListResponseBodyDataDomain, domain *alidns.DescribeDomainsResponseBodyDomainsDomain) (d Domain) {
for _, v := range domainList {
if tea.StringValue(v.DomainName) == tea.StringValue(domain.DomainName) {
d.CreatedDate = tea.StringValue(v.RegistrationDate)
d.ExpiryDate = tea.StringValue(v.ExpirationDate)
if d.ExpiryDate != "" {
d.DaysUntilExpiry = carbon.Now().DiffInDays(carbon.Parse(d.ExpiryDate))
}
}
}
return
}
16 changes: 9 additions & 7 deletions pkg/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ func init() {

// Doamin 域名信息
type Domain struct {
CloudProvider string `json:"cloud_provider"`
CloudName string `json:"cloud_name"`
DomainID string `json:"domain_id"`
DomainName string `json:"domain_name"`
DomainRemark string `json:"domain_remark"`
DomainStatus string `json:"domain_status"`
CreateTime string `json:"create_time"`
CloudProvider string `json:"cloud_provider"`
CloudName string `json:"cloud_name"`
DomainID string `json:"domain_id"`
DomainName string `json:"domain_name"`
DomainRemark string `json:"domain_remark"`
DomainStatus string `json:"domain_status"`
CreatedDate string `json:"created_date"`
ExpiryDate string `json:"expiry_date"`
DaysUntilExpiry int64 `json:"days_until_expiry"`
}

// Record 域名记录信息
Expand Down
77 changes: 68 additions & 9 deletions pkg/provider/tencent.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ import (
"time"

"github.com/alibabacloud-go/tea/tea"
"github.com/eryajf/cloud_dns_exporter/pkg/logger"
"github.com/eryajf/cloud_dns_exporter/public/logger"
"github.com/golang-module/carbon/v2"

"github.com/eryajf/cloud_dns_exporter/public"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"
dnspod "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod/v20210323"
domain "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/domain/v20180808"
)

type TencentCloudDNS struct {
Expand Down Expand Up @@ -62,15 +65,22 @@ func (t *TencentCloudDNS) ListDomains() ([]Domain, error) {
if err != nil {
return nil, err
}
domainNames, err := t.getDomainNameList()
if err != nil {
return nil, err
}
for _, v := range domains {
domainCreateAndExpiryDate := t.getDomainCreateAndExpiryDate(domainNames, v)
dataObj = append(dataObj, Domain{
CloudProvider: t.account.CloudProvider,
CloudName: t.account.CloudName,
DomainID: fmt.Sprintf("%d", tea.Uint64Value(v.DomainId)),
DomainName: tea.StringValue(v.Name),
DomainRemark: tea.StringValue(v.Remark),
DomainStatus: oneStatus(tea.StringValue(v.Status)),
CreateTime: tea.StringValue(v.CreatedOn),
CloudProvider: t.account.CloudProvider,
CloudName: t.account.CloudName,
DomainID: fmt.Sprintf("%d", tea.Uint64Value(v.DomainId)),
DomainName: tea.StringValue(v.Name),
DomainRemark: tea.StringValue(v.Remark),
DomainStatus: oneStatus(tea.StringValue(v.Status)),
CreatedDate: domainCreateAndExpiryDate.CreatedDate,
ExpiryDate: domainCreateAndExpiryDate.ExpiryDate,
DaysUntilExpiry: domainCreateAndExpiryDate.DaysUntilExpiry,
})
}
return dataObj, nil
Expand Down Expand Up @@ -142,7 +152,7 @@ func (t *TencentCloudDNS) ListRecords() ([]Record, error) {
}

// https://cloud.tencent.com/document/api/1427/56172
// GetDomainList 获取云账号下域名列表
// GetDomainList 获取云解析中域名列表
func (t *TencentCloudDNS) getDomainList() ([]*dnspod.DomainListItem, error) {
request := dnspod.NewDescribeDomainListRequest()
response, err := t.client.DescribeDomainList(request)
Expand Down Expand Up @@ -185,3 +195,52 @@ func (t *TencentCloudDNS) getRecordList(domain string) ([]*dnspod.RecordListItem
}
return temp, nil
}

// https://cloud.tencent.com/document/api/242/48941
// getDomainNameList 获取域名列表(与云解析的域名列表注意区分)
func (t *TencentCloudDNS) getDomainNameList() ([]*domain.DomainList, error) {
var (
offset uint64 = 0
limit uint64 = 100
temp []*domain.DomainList
)
cpf := profile.NewClientProfile()
cpf.HttpProfile.Endpoint = "domain.tencentcloudapi.com"
client, _ := domain.NewClient(common.NewCredential(
t.account.SecretID,
t.account.SecretKey,
), "", cpf)

request := domain.NewDescribeDomainNameListRequest()
for {
request.Offset = common.Uint64Ptr(offset)
request.Limit = common.Uint64Ptr(limit)
response, err := client.DescribeDomainNameList(request)
if _, ok := err.(*errors.TencentCloudSDKError); ok {
return nil, err
}
if err != nil {
return nil, err
}
temp = append(temp, response.Response.DomainSet...)
if len(response.Response.DomainSet) == 0 {
break
}
offset += limit
}
return temp, nil
}

// getDomainCreateAndExpiryDate 获取域名的创建时间与到期时间
func (t *TencentCloudDNS) getDomainCreateAndExpiryDate(domainList []*domain.DomainList, domain *dnspod.DomainListItem) (d Domain) {
for _, v := range domainList {
if tea.StringValue(v.DomainName) == tea.StringValue(domain.Name) {
d.CreatedDate = tea.StringValue(v.CreationDate)
d.ExpiryDate = tea.StringValue(v.ExpirationDate)
if d.ExpiryDate != "" {
d.DaysUntilExpiry = carbon.Now().DiffInDays(carbon.Parse(d.ExpiryDate))
}
}
}
return
}
8 changes: 0 additions & 8 deletions pkg/tools/time.go

This file was deleted.

File renamed without changes.
3 changes: 2 additions & 1 deletion public/public.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import (
"time"

"github.com/allegro/bigcache/v3"
"github.com/eryajf/cloud_dns_exporter/pkg/logger"
"github.com/eryajf/cloud_dns_exporter/public/logger"

"gopkg.in/yaml.v2"
)

Expand Down

0 comments on commit 52e799c

Please sign in to comment.