ctx

package
v0.0.0-...-783ac1f Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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) Chats

func (c *ChatContext) Chats() ([]*model.Chat, 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

func (*ChatContext) Write

func (c *ChatContext) Write(data []byte) (int64, error)

Jump to

Keyboard shortcuts

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