v2ray-core/vconfig.go

33 lines
741 B
Go
Raw Normal View History

2015-09-05 15:48:38 +00:00
package core
2015-09-10 22:24:18 +00:00
import (
v2net "github.com/v2ray/v2ray-core/net"
)
// VUser is the user account that is used for connection to a VPoint
2015-09-05 15:48:38 +00:00
type VUser struct {
Id VID // The ID of this VUser.
2015-09-05 15:48:38 +00:00
}
// VNext is the next VPoint server in the connection chain.
2015-09-07 10:00:46 +00:00
type VNext struct {
2015-09-10 22:24:18 +00:00
Address v2net.VAddress // Address of VNext server
Users []VUser // User accounts for accessing VNext.
2015-09-07 10:00:46 +00:00
}
// VConfig is the config for VPoint server.
2015-09-05 15:48:38 +00:00
type VConfig struct {
2015-09-07 23:35:19 +00:00
Port uint16 // Port of this VPoint server.
2015-09-07 10:00:46 +00:00
AllowedClients []VUser
ClientProtocol string
VNextList []VNext
2015-09-05 15:48:38 +00:00
}
type VConfigMarshaller interface {
2015-09-06 20:10:42 +00:00
Marshal(config VConfig) ([]byte, error)
2015-09-05 15:48:38 +00:00
}
type VConfigUnmarshaller interface {
2015-09-06 20:10:42 +00:00
Unmarshal(data []byte) (VConfig, error)
2015-09-05 15:48:38 +00:00
}