vconfig.go 752 B

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