struct.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package core
  2. import (
  3. "errors"
  4. )
  5. type Stage uint8
  6. // These constants are meant to describe the stage in which the plugin is running.
  7. const (
  8. STAGE_START Stage = iota
  9. STAGE_END
  10. STAGE_RUN
  11. PROXY_CONNECTION_TYPE = "proxy_target_type"
  12. PROXY_CONNECTION_ADDR = "proxy_target_addr"
  13. PROXY_CONNECTION_PORT = "proxy_target_port"
  14. CLIENT_CONNECTION = "clientConn"
  15. BRIDGE = "bridge"
  16. CLIENT_ID = "client_id"
  17. )
  18. type ConfigLevel uint8
  19. const (
  20. CONFIG_LEVEL_CLIENT ConfigLevel = iota // client-level configuration
  21. CONFIG_LEVEL_PLUGIN // plugin level control
  22. CONFIG_LEVEL_GLOBAL // global configuration
  23. )
  24. type ConfigInputType uint8
  25. const (
  26. CONFIG_INPUT_TEXT ConfigInputType = iota // show as single line input box
  27. CONFIG_INPUT_SWITCH // show as switch
  28. CONFIG_INPUT_TEXTAREA // show as a multi-line input box
  29. )
  30. var (
  31. CLIENT_CONNECTION_NOT_EXIST = errors.New("the client connection is not exist")
  32. BRIDGE_NOT_EXIST = errors.New("the bridge is not exist")
  33. REQUEST_EOF = errors.New("the request has finished")
  34. CLIENT_ID_NOT_EXIST = errors.New("the client id is not exist")
  35. )