mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-21 02:40:24 +08:00
feat: split udp protocol to folder p2p
This commit is contained in:
@@ -8,20 +8,12 @@ import (
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
// EndPoint 一个终结点的信息
|
||||
type EndPoint struct {
|
||||
Host string `yaml:"Host"`
|
||||
Port int64 `yaml:"Port"`
|
||||
Poly uint64 `yaml:"Poly"` // Poly 是 port 随机切换算法的生成多项式, 0 为禁用
|
||||
ReconnectSeconds int64 `yaml:"ReconnectSeconds"` // ReconnectSeconds 断开重连间隔, 每次到时即向对端通报并切换到新的端口, 0 为禁用
|
||||
FECMethod string `yaml:"FECMethod"` // FECMethod 可选 1/2 2/3
|
||||
}
|
||||
|
||||
// Config WireGold 配置文件
|
||||
type Config struct {
|
||||
IP string `yaml:"IP"`
|
||||
SubNet string `yaml:"SubNet"`
|
||||
PrivateKey string `yaml:"PrivateKey"`
|
||||
Network string `yaml:"Network"` // Network udp or ws (WIP)
|
||||
EndPoint string `yaml:"EndPoint"`
|
||||
MTU int64 `yaml:"MTU"`
|
||||
SpeedLoop uint16 `yaml:"SpeedLoop"`
|
||||
@@ -32,7 +24,6 @@ type Config struct {
|
||||
// Peer 对端信息
|
||||
type Peer struct {
|
||||
IP string `yaml:"IP"`
|
||||
SubNet string `yaml:"SubNet"`
|
||||
PublicKey string `yaml:"PublicKey"`
|
||||
PresharedKey string `yaml:"PresharedKey"`
|
||||
EndPoint string `yaml:"EndPoint"`
|
||||
|
||||
Reference in New Issue
Block a user