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