Skip to content

Commit 0be838d

Browse files
committed
域名服务增加访问日志
1 parent e4d958f commit 0be838d

14 files changed

+1960
-486
lines changed

pkg/dnsconfigs/access_log_ref.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2021 Liuxiangchao [email protected]. All rights reserved.
2+
3+
package dnsconfigs
4+
5+
type AccessLogRef struct {
6+
IsPrior bool `yaml:"isPrior" json:"isPrior"` // 是否覆盖
7+
IsOn bool `yaml:"isOn" json:"isOn"` // 是否启用
8+
}
9+
10+
func (this *AccessLogRef) Init() error {
11+
return nil
12+
}

pkg/dnsconfigs/ns_node_config.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2021 Liuxiangchao [email protected]. All rights reserved.
2+
3+
package dnsconfigs
4+
5+
import "fmt"
6+
7+
type NSNodeConfig struct {
8+
Id int64 `json:"id"`
9+
ClusterId int64 `json:"clusterId"`
10+
AccessLogRef *AccessLogRef `json:"accessLogRef"`
11+
12+
paddedId string
13+
}
14+
15+
func (this *NSNodeConfig) Init() error {
16+
this.paddedId = fmt.Sprintf("%08d", this.Id)
17+
18+
// accessLog
19+
if this.AccessLogRef != nil {
20+
err := this.AccessLogRef.Init()
21+
if err != nil {
22+
return err
23+
}
24+
}
25+
26+
return nil
27+
}
28+
29+
func (this *NSNodeConfig) PaddedId() string {
30+
return this.paddedId
31+
}

pkg/rpc/pb/model_ns_access_log.pb.go

Lines changed: 289 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)