typedef.go 935 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package access
  2. import (
  3. "sync"
  4. "imuslab.com/zoraxy/mod/database"
  5. "imuslab.com/zoraxy/mod/geodb"
  6. "imuslab.com/zoraxy/mod/info/logger"
  7. )
  8. type Options struct {
  9. Logger logger.Logger
  10. ConfigFolder string //Path for storing config files
  11. GeoDB *geodb.Store //For resolving country code
  12. Database *database.Database //System key-value database
  13. }
  14. type AccessRule struct {
  15. ID string
  16. Name string
  17. Desc string
  18. BlacklistEnabled bool
  19. WhitelistEnabled bool
  20. /* Whitelist Blacklist Table, value is comment if supported */
  21. WhiteListCountryCode *map[string]string
  22. WhiteListIP *map[string]string
  23. BlackListContryCode *map[string]string
  24. BlackListIP *map[string]string
  25. parent *Controller
  26. }
  27. type Controller struct {
  28. DefaultAccessRule *AccessRule
  29. ProxyAccessRule *sync.Map
  30. Options *Options
  31. }