chat

package
v0.0.0-...-8027ee6 Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chat

type Chat struct {
	Pool *pool.Pool
	Name string
}

func Get

func Get(p *pool.Pool, name string) Chat

func (*Chat) Privates

func (c *Chat) Privates() ([]Private, error)

func (*Chat) Receive

func (c *Chat) Receive(after, before time.Time, limit int, private Private) ([]Message, error)

func (*Chat) Reset

func (c *Chat) Reset() error

Reset removes all the local content

func (*Chat) SendMessage

func (c *Chat) SendMessage(contentType string, text string, binary []byte, private Private) (uint64, error)

type Message

type Message struct {
	Id          uint64    `json:"id,string"`
	Author      string    `json:"author"`
	Time        time.Time `json:"time"`
	ContentType string    `json:"contentType"`
	Text        string    `json:"text"`
	Binary      []byte    `json:"binary"`
	Preview     []byte    `json:"preview"`
	Signature   []byte    `json:"signature"`
}

type Private

type Private []string

Private is a list of the user ids that have exclusive access to the chat

Jump to

Keyboard shortcuts

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