model

package
v0.0.0-...-860f676 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: Unlicense Imports: 4 Imported by: 0

Documentation

Overview

Package model provides the domain-specific data models for this list.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DateBoundary

type DateBoundary struct {
	Date time.Time
}

DateBoundary represents a change in the date during a chat.

func (DateBoundary) Serial

func (d DateBoundary) Serial() list.Serial

Serial returns the unique identifier of the message.

type Message

type Message struct {
	SerialID                      string
	Title, Content, AlbumId, Type string
	ParentId                      []string
	SentAt                        time.Time
	Avatar                        image.Image
	Read                          bool
}

Message represents a chat message.

func (Message) Serial

func (m Message) Serial() list.Serial

Serial returns the unique identifier for this message.

type Messages

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

func (*Messages) Add

func (us *Messages) Add(u Message)

func (*Messages) GetList

func (us *Messages) GetList() (list []Message)

func (*Messages) List

func (us *Messages) List() (list []*Message)

type Room

type Room struct {
	// Image avatar for the room.
	Image image.Image
	// Name of the room.
	Name string
	// Channel id
	Id       string
	Count    string
	Content  string
	Selected []string
	IsBase   bool
	Loaded   bool
}

Room is a unique conversation context. Room can have any number of participants, and any number of messages. Any participant of a room should be able to view the room, send messages to and receive messages from the other participants.

type Rooms

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

Rooms structure manages a collection of rooms.

func (*Rooms) Add

func (r *Rooms) Add(room Room)

Add room to collection.

func (*Rooms) List

func (r *Rooms) List() (list []*Room)

List returns an ordered list of room data.

type UnreadBoundary

type UnreadBoundary struct{}

UnreadBoundary represents the boundary between the last read message in a chat and the next unread message.

func (UnreadBoundary) Serial

func (u UnreadBoundary) Serial() list.Serial

Serial returns the unique identifier for the boundary.

Jump to

Keyboard shortcuts

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