Documentation ¶
Index ¶
- Constants
- type AutoLogin
- type AutoLoginState
- type Connect
- type ConnectState
- type Disconnect
- type DisconnectState
- type ErrInvalidDataType
- type Error
- type HandlerRegistrator
- type Heartbeat
- type HeartbeatList
- type HeartbeatListState
- type HeartbeatState
- type ImportantHeartbeatList
- type ImportantHeartbeatListState
- type Info
- type InfoState
- type Message
- type MonitorList
- type MonitorState
Constants ¶
const ( HeartbeatEvent = "heartbeat" HeartbeatListEvent = "heartbeatList" ImportantHeartbeatListEvent = "importantHeartbeatList" )
const (
AutoLoginEvent = "autoLogin"
)
const (
ConnectEvent = shadiaosocketio.OnConnection
)
const (
DisconnectEvent = shadiaosocketio.OnDisconnection
)
const (
ErrorEvent = shadiaosocketio.OnError
)
const (
InfoEvent = "info"
)
const (
MessageEvent = shadiaosocketio.OnMessage
)
const (
MonitorListEvent = "monitorList"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoLogin ¶
type AutoLogin struct {
// contains filtered or unexported fields
}
func NewAutoLogin ¶
func NewAutoLogin(state AutoLoginState) *AutoLogin
NewAutoLogin creates a new AutoLogin handler.
func (*AutoLogin) Callback ¶
func (al *AutoLogin) Callback(ch *shadiaosocketio.Channel) error
Callback is the function that is called when the event is received.
func (*AutoLogin) Occurred ¶
Occurred returns true if the event has occurred, false otherwise. Required in some places to make sure a specific event has been sent before continuing.
func (*AutoLogin) Register ¶
func (al *AutoLogin) Register(h HandlerRegistrator) error
Register registers the handler with the client.
type AutoLoginState ¶
type Connect ¶
type Connect struct {
// contains filtered or unexported fields
}
Connect is a handler for the connect event.
func NewConnect ¶
func NewConnect(state ConnectState) *Connect
NewConnect returns a new Connect handler.
func (*Connect) Callback ¶
func (c *Connect) Callback(ch *shadiaosocketio.Channel) error
Callback handles the event.
func (*Connect) Register ¶
func (c *Connect) Register(h HandlerRegistrator) error
Register registers the handler.
type ConnectState ¶
type Disconnect ¶
type Disconnect struct {
// contains filtered or unexported fields
}
Disconnect is a handler for the disconnect event.
func NewDisconnect ¶
func NewDisconnect(state DisconnectState) *Disconnect
NewDisconnect returns a new Disconnect handler.
func (*Disconnect) Callback ¶
func (d *Disconnect) Callback(ch *shadiaosocketio.Channel, reason websocket.CloseError) error
Callback handles the event.
func (*Disconnect) Occurred ¶
func (d *Disconnect) Occurred() bool
Occurred returns true if the event has occurred at least once.
func (*Disconnect) Register ¶
func (d *Disconnect) Register(h HandlerRegistrator) error
Register registers the handler.
type DisconnectState ¶
type ErrInvalidDataType ¶
func NewErrInvalidDataType ¶
func NewErrInvalidDataType(expected string, actual any) ErrInvalidDataType
func (ErrInvalidDataType) Error ¶
func (e ErrInvalidDataType) Error() string
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func (*Error) Register ¶
func (e *Error) Register(h HandlerRegistrator) error
type HandlerRegistrator ¶
HandlerRegistrator is an interface that defines the methods that the handler registration requires.
type Heartbeat ¶
type Heartbeat struct {
// contains filtered or unexported fields
}
func NewHeartbeat ¶
func NewHeartbeat(state HeartbeatState) *Heartbeat
func (*Heartbeat) Callback ¶
func (hn *Heartbeat) Callback(h *shadiaosocketio.Channel, data any) error
func (*Heartbeat) Register ¶
func (hn *Heartbeat) Register(h HandlerRegistrator) error
type HeartbeatList ¶
type HeartbeatList struct {
// contains filtered or unexported fields
}
func NewHeartbeatList ¶
func NewHeartbeatList(state HeartbeatListState) *HeartbeatList
func (*HeartbeatList) Callback ¶
func (hn *HeartbeatList) Callback(h *shadiaosocketio.Channel, id any, result []any, overwrite any) error
func (*HeartbeatList) Event ¶
func (hn *HeartbeatList) Event() string
func (*HeartbeatList) Occurred ¶
func (hn *HeartbeatList) Occurred() bool
func (*HeartbeatList) Register ¶
func (hn *HeartbeatList) Register(h HandlerRegistrator) error
type HeartbeatListState ¶
type HeartbeatState ¶
type ImportantHeartbeatList ¶
type ImportantHeartbeatList struct {
// contains filtered or unexported fields
}
func NewImportantHeartbeatList ¶
func NewImportantHeartbeatList(state ImportantHeartbeatListState) *ImportantHeartbeatList
func (*ImportantHeartbeatList) Callback ¶
func (hn *ImportantHeartbeatList) Callback(h *shadiaosocketio.Channel, id any, result []any, overwrite any) error
func (*ImportantHeartbeatList) Event ¶
func (hn *ImportantHeartbeatList) Event() string
func (*ImportantHeartbeatList) Occurred ¶
func (hn *ImportantHeartbeatList) Occurred() bool
func (*ImportantHeartbeatList) Register ¶
func (hn *ImportantHeartbeatList) Register(h HandlerRegistrator) error
type Info ¶
type Info struct {
// contains filtered or unexported fields
}
func (*Info) Register ¶
func (i *Info) Register(h HandlerRegistrator) error
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func NewMessage ¶
func (*Message) Register ¶
func (m *Message) Register(h HandlerRegistrator) error
type MonitorList ¶
type MonitorList struct {
// contains filtered or unexported fields
}
func NewMonitorList ¶
func NewMonitorList(state MonitorState) *MonitorList
func (MonitorList) Callback ¶
func (ml MonitorList) Callback(ch *shadiaosocketio.Channel, data any) error
func (MonitorList) Event ¶
func (ml MonitorList) Event() string
func (MonitorList) Occurred ¶
func (ml MonitorList) Occurred() bool
func (MonitorList) Register ¶
func (ml MonitorList) Register(h HandlerRegistrator) error