event.go 385 B

12345678910111213141516171819202122232425262728
  1. package event
  2. import (
  3. "errors"
  4. "github.com/fatedier/frp/pkg/msg"
  5. )
  6. type Type int
  7. const (
  8. EvStartProxy Type = iota
  9. EvCloseProxy
  10. )
  11. var (
  12. ErrPayloadType = errors.New("error payload type")
  13. )
  14. type Handler func(evType Type, payload interface{}) error
  15. type StartProxyPayload struct {
  16. NewProxyMsg *msg.NewProxy
  17. }
  18. type CloseProxyPayload struct {
  19. CloseProxyMsg *msg.CloseProxy
  20. }