frp/client/event/event.go

29 lines
388 B
Go
Raw Normal View History

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