chat

package
v0.0.0-...-6f5c55b Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chatroom

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

func (*Chatroom) GetUsers

func (c *Chatroom) GetUsers() []*User

type Message

type Message struct {
	Id      uint
	Date    int64
	Message string
	User    *User
}

type Subscription

type Subscription struct {
	Id        uint
	Messages  chan *Message
	UserEnter chan *User
	UserExit  chan *User
	// contains filtered or unexported fields
}

func Subscribe

func Subscribe(chatroomName string, user *User) *Subscription

func (*Subscription) SendMessage

func (s *Subscription) SendMessage(message *Message)

func (*Subscription) Unsubscribe

func (s *Subscription) Unsubscribe()

type User

type User struct {
	Id       uint
	Username string
}

Jump to

Keyboard shortcuts

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