channelService

package
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	// contains filtered or unexported fields
}

func NewChannel

func NewChannel(name string) *Channel

func (*Channel) Add

func (c *Channel) Add(s *rpc.Session) error

Add user to channel.

func (*Channel) GetMembers

func (c *Channel) GetMembers() []int64

Get userId array

func (*Channel) GetSessions

func (c *Channel) GetSessions() map[int64]*rpc.Session

func (*Channel) Leave

func (c *Channel) Leave(uid int64)

Remove user from channel.

func (*Channel) PushMessage

func (c *Channel) PushMessage(route string, msg interface{}, excludeUid []int64)

Push message to all the members in the channel, exclude uid in the excludeUid.

type ChannelService

type ChannelService struct {
	// contains filtered or unexported fields
}

func GetChannelService

func GetChannelService() *ChannelService

func (*ChannelService) AsyncPushMessageBySid

func (c *ChannelService) AsyncPushMessageBySid(nodeId string, route string, msg interface{}, sids []int64)

func (*ChannelService) Broadcast

func (c *ChannelService) Broadcast(nodeId string, route string, msg interface{})

func (*ChannelService) CreateChannel

func (c *ChannelService) CreateChannel(name string) *Channel

func (*ChannelService) DestroyChannel

func (c *ChannelService) DestroyChannel(name string)

func (*ChannelService) GetChannel

func (c *ChannelService) GetChannel(name string) *Channel

func (*ChannelService) PushMessageBySid

func (c *ChannelService) PushMessageBySid(nodeId string, route string, msg interface{}, sids []int64)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL