vconfig.go 741 B

1234567891011121314151617181920212223242526272829303132
  1. package core
  2. import (
  3. v2net "github.com/v2ray/v2ray-core/net"
  4. )
  5. // VUser is the user account that is used for connection to a VPoint
  6. type VUser struct {
  7. Id VID // The ID of this VUser.
  8. }
  9. // VNext is the next VPoint server in the connection chain.
  10. type VNext struct {
  11. Address v2net.VAddress // Address of VNext server
  12. Users []VUser // User accounts for accessing VNext.
  13. }
  14. // VConfig is the config for VPoint server.
  15. type VConfig struct {
  16. Port uint16 // Port of this VPoint server.
  17. AllowedClients []VUser
  18. ClientProtocol string
  19. VNextList []VNext
  20. }
  21. type VConfigMarshaller interface {
  22. Marshal(config VConfig) ([]byte, error)
  23. }
  24. type VConfigUnmarshaller interface {
  25. Unmarshal(data []byte) (VConfig, error)
  26. }