frp/client/event/event.go

29 lines
385 B
Go
Raw Normal View History

2018-12-09 14:06:22 +00:00
package event
2018-12-07 09:05:36 +00:00
import (
"errors"
2020-09-23 05:49:14 +00:00
"github.com/fatedier/frp/pkg/msg"
2018-12-07 09:05:36 +00:00
)
2020-05-24 09:48:37 +00:00
type Type int
2018-12-07 09:05:36 +00:00
const (
2020-05-24 09:48:37 +00:00
EvStartProxy Type = iota
2018-12-07 09:05:36 +00:00
EvCloseProxy
)
var (
ErrPayloadType = errors.New("error payload type")
)
2020-05-24 09:48:37 +00:00
type Handler func(evType Type, payload interface{}) error
2018-12-07 09:05:36 +00:00
type StartProxyPayload struct {
NewProxyMsg *msg.NewProxy
}
type CloseProxyPayload struct {
CloseProxyMsg *msg.CloseProxy
}