mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2026-04-24 14:55:18 +08:00
在各个地方支持IPv6
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
package serverconfigs
|
||||
|
||||
// 协议基础数据结构
|
||||
// BaseProtocol 协议基础数据结构
|
||||
type BaseProtocol struct {
|
||||
IsOn bool `yaml:"isOn" json:"isOn"` // 是否开启
|
||||
Listen []*NetworkAddressConfig `yaml:"listen" json:"listen"` // 绑定的网络地址
|
||||
}
|
||||
|
||||
// 初始化
|
||||
// InitBase 初始化
|
||||
func (this *BaseProtocol) InitBase() error {
|
||||
for _, addr := range this.Listen {
|
||||
err := addr.Init()
|
||||
@@ -17,7 +17,7 @@ func (this *BaseProtocol) InitBase() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// 获取完整的地址列表
|
||||
// FullAddresses 获取完整的地址列表
|
||||
func (this *BaseProtocol) FullAddresses() []string {
|
||||
result := []string{}
|
||||
for _, addr := range this.Listen {
|
||||
@@ -26,7 +26,7 @@ func (this *BaseProtocol) FullAddresses() []string {
|
||||
return result
|
||||
}
|
||||
|
||||
// 添加地址
|
||||
// AddListen 添加地址
|
||||
func (this *BaseProtocol) AddListen(addr ...*NetworkAddressConfig) {
|
||||
this.Listen = append(this.Listen, addr...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user