Documentation ¶
Index ¶
- Variables
- type ChatContext
- func (c *ChatContext) Broadcast(msg string) error
- func (c *ChatContext) ChangeChat(chatId int64) error
- func (c *ChatContext) Chats() ([]*model.Chat, error)
- func (c *ChatContext) Conn() *network.Conn
- func (c *ChatContext) Connect(servers []string) error
- func (c *ChatContext) CreateChat(name string) (*model.Chat, error)
- func (c *ChatContext) DeleteChat(chatId int64) (*model.Chat, error)
- func (c *ChatContext) Leave() error
- func (c *ChatContext) ListenerBroadcast()
- func (c *ChatContext) OffListenerBroadcast()
- func (c *ChatContext) Rename(name string) error
- func (c *ChatContext) Write(data []byte) (int64, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
NotifyTimeOutErr = errors.New("notify time out of 3s")
)
Functions ¶
This section is empty.
Types ¶
type ChatContext ¶
type ChatContext struct { Name string `json:"name"` // contains filtered or unexported fields }
func NewContext ¶
func NewContext(name, net string) *ChatContext
func (*ChatContext) Broadcast ¶
func (c *ChatContext) Broadcast(msg string) error
func (*ChatContext) ChangeChat ¶
func (c *ChatContext) ChangeChat(chatId int64) error
func (*ChatContext) Conn ¶
func (c *ChatContext) Conn() *network.Conn
func (*ChatContext) Connect ¶
func (c *ChatContext) Connect(servers []string) error
func (*ChatContext) CreateChat ¶
func (c *ChatContext) CreateChat(name string) (*model.Chat, error)
func (*ChatContext) DeleteChat ¶
func (c *ChatContext) DeleteChat(chatId int64) (*model.Chat, error)
func (*ChatContext) Leave ¶
func (c *ChatContext) Leave() error
func (*ChatContext) ListenerBroadcast ¶
func (c *ChatContext) ListenerBroadcast()
func (*ChatContext) OffListenerBroadcast ¶
func (c *ChatContext) OffListenerBroadcast()
func (*ChatContext) Rename ¶
func (c *ChatContext) Rename(name string) error
Click to show internal directories.
Click to hide internal directories.