2021-06-02 11:53:15 +08:00
|
|
|
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
|
|
|
|
|
|
|
|
|
package dnsconfigs
|
|
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
|
|
type NSNodeConfig struct {
|
2021-08-07 20:40:36 +08:00
|
|
|
Id int64 `yaml:"id" json:"id"`
|
|
|
|
|
NodeId string `yaml:"nodeId" json:"nodeId"`
|
2021-08-09 18:42:06 +08:00
|
|
|
Secret string `yaml:"secret" json:"secret"`
|
2021-08-07 20:40:36 +08:00
|
|
|
ClusterId int64 `yaml:"clusterId" json:"clusterId"`
|
|
|
|
|
AccessLogRef *NSAccessLogRef `yaml:"accessLogRef" json:"accessLogRef"`
|
2021-06-02 11:53:15 +08:00
|
|
|
|
|
|
|
|
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
|
|
|
|
|
}
|