Documentation ¶
Index ¶
- type Channel
- func (ch *Channel) ClientEvent(_socket *socket.Socket, data *types.Data)
- func (ch *Channel) IsClientEvent(event string) bool
- func (ch *Channel) IsInChannel(_socket *socket.Socket, channel string) bool
- func (ch *Channel) IsPresence(channel string) bool
- func (ch *Channel) IsPrivate(channel string) bool
- func (ch *Channel) Join(_socket *socket.Socket, data *types.Data)
- func (ch *Channel) JoinPrivate(_socket *socket.Socket, data *types.Data)
- func (ch *Channel) Leave(_socket *socket.Socket, channel string, reason string)
- func (ch *Channel) OnJoin(_socket *socket.Socket, channel string)
- type PresenceChannel
- func (pch *PresenceChannel) Close() error
- func (pch *PresenceChannel) GetMembers(channel string) (members types.Members, _ error)
- func (pch *PresenceChannel) IsMember(channel string, member *types.Member) (bool, error)
- func (pch *PresenceChannel) Join(socket *socket.Socket, channel string, member *types.Member) error
- func (pch *PresenceChannel) Leave(socket *socket.Socket, channel string) error
- func (pch *PresenceChannel) OnJoin(_socket *socket.Socket, channel string, member *types.Member)
- func (pch *PresenceChannel) OnLeave(channel string, member *types.Member)
- func (pch *PresenceChannel) OnSubscribed(_socket *socket.Socket, channel string, members types.Members)
- func (pch *PresenceChannel) RemoveInactive(channel string, members types.Members, member *types.Member) (_members types.Members, _ error)
- type PrivateChannel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct { // Private channel instance. Private *PrivateChannel // Presence channel instance. Presence *PresenceChannel // contains filtered or unexported fields }
func NewChannel ¶
Create a new channel instance.
func (*Channel) ClientEvent ¶
Trigger a client message
func (*Channel) IsClientEvent ¶
Check if client is a client event
func (*Channel) IsInChannel ¶
Check if a socket has joined a channel.
func (*Channel) IsPresence ¶
Check if a channel is a presence channel.
func (*Channel) JoinPrivate ¶
Join private channel, emit data to presence channels.
type PresenceChannel ¶
type PresenceChannel struct {
// contains filtered or unexported fields
}
func NewPresenceChannel ¶
func NewPresenceChannel(io *socket.Server, _options *options.Config) (pch *PresenceChannel, err error)
Create a NewPresence channel instance.
func (*PresenceChannel) Close ¶ added in v1.1.0
func (pch *PresenceChannel) Close() error
func (*PresenceChannel) GetMembers ¶
func (pch *PresenceChannel) GetMembers(channel string) (members types.Members, _ error)
Get the members of a presence channel.
func (*PresenceChannel) Join ¶
Join a presence channel and emit that they have joined only if it is the first instance of their presence.
func (*PresenceChannel) Leave ¶
func (pch *PresenceChannel) Leave(socket *socket.Socket, channel string) error
Remove a member from a presenece channel and broadcast they have left only if not other presence channel instances exist.
func (*PresenceChannel) OnLeave ¶
func (pch *PresenceChannel) OnLeave(channel string, member *types.Member)
On Leave emitter.
func (*PresenceChannel) OnSubscribed ¶
func (pch *PresenceChannel) OnSubscribed(_socket *socket.Socket, channel string, members types.Members)
On subscribed event emitter.
type PrivateChannel ¶
type PrivateChannel struct {
// contains filtered or unexported fields
}
func NewPrivateChannel ¶
func NewPrivateChannel(_options *options.Config) *PrivateChannel
Create a new private channel instance.
func (*PrivateChannel) Authenticate ¶
Send authentication request to application server.