2015-09-05 11:48:38 -04:00
|
|
|
package core
|
|
|
|
|
2015-09-07 06:00:46 -04:00
|
|
|
// User account that is used for connection to a VPoint
|
2015-09-05 11:48:38 -04:00
|
|
|
type VUser struct {
|
2015-09-07 06:00:46 -04:00
|
|
|
// The ID of this VUser. This ID is served as an access token.
|
|
|
|
// It is not necessary to be permanent.
|
2015-09-06 16:10:42 -04:00
|
|
|
id VID
|
2015-09-05 11:48:38 -04:00
|
|
|
}
|
|
|
|
|
2015-09-07 06:00:46 -04:00
|
|
|
// The next VPoint server in the connection chain.
|
|
|
|
type VNext struct {
|
|
|
|
// Address of VNext server, in the form of "IP:Port"
|
|
|
|
ServerAddress string
|
|
|
|
// User accounts for accessing VNext.
|
|
|
|
User []VUser
|
|
|
|
}
|
|
|
|
|
|
|
|
// The config for VPoint server.
|
2015-09-05 11:48:38 -04:00
|
|
|
type VConfig struct {
|
2015-09-07 06:00:46 -04:00
|
|
|
// Port of this VPoint server.
|
|
|
|
Port uint16
|
|
|
|
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
|
|
|
}
|