vconfig.go 679 B

12345678910111213141516171819202122232425262728
  1. package core
  2. // User account that is used for connection to a VPoint
  3. type VUser struct {
  4. id VID // The ID of this VUser.
  5. }
  6. // The next VPoint server in the connection chain.
  7. type VNext struct {
  8. ServerAddress string // Address of VNext server, in the form of "IP:Port"
  9. User []VUser // User accounts for accessing VNext.
  10. }
  11. // The config for VPoint server.
  12. type VConfig struct {
  13. Port uint16 // Port of this VPoint server.
  14. AllowedClients []VUser
  15. ClientProtocol string
  16. VNextList []VNext
  17. }
  18. type VConfigMarshaller interface {
  19. Marshal(config VConfig) ([]byte, error)
  20. }
  21. type VConfigUnmarshaller interface {
  22. Unmarshal(data []byte) (VConfig, error)
  23. }