mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2026-04-18 00:55:19 +08:00
域名服务增加访问日志
This commit is contained in:
12
pkg/dnsconfigs/access_log_ref.go
Normal file
12
pkg/dnsconfigs/access_log_ref.go
Normal file
@@ -0,0 +1,12 @@
|
||||
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
||||
|
||||
package dnsconfigs
|
||||
|
||||
type AccessLogRef struct {
|
||||
IsPrior bool `yaml:"isPrior" json:"isPrior"` // 是否覆盖
|
||||
IsOn bool `yaml:"isOn" json:"isOn"` // 是否启用
|
||||
}
|
||||
|
||||
func (this *AccessLogRef) Init() error {
|
||||
return nil
|
||||
}
|
||||
31
pkg/dnsconfigs/ns_node_config.go
Normal file
31
pkg/dnsconfigs/ns_node_config.go
Normal file
@@ -0,0 +1,31 @@
|
||||
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
||||
|
||||
package dnsconfigs
|
||||
|
||||
import "fmt"
|
||||
|
||||
type NSNodeConfig struct {
|
||||
Id int64 `json:"id"`
|
||||
ClusterId int64 `json:"clusterId"`
|
||||
AccessLogRef *AccessLogRef `json:"accessLogRef"`
|
||||
|
||||
paddedId string
|
||||
}
|
||||
|
||||
func (this *NSNodeConfig) Init() error {
|
||||
this.paddedId = fmt.Sprintf("%08d", this.Id)
|
||||
|
||||
// accessLog
|
||||
if this.AccessLogRef != nil {
|
||||
err := this.AccessLogRef.Init()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (this *NSNodeConfig) PaddedId() string {
|
||||
return this.paddedId
|
||||
}
|
||||
Reference in New Issue
Block a user