model

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment added in v0.1.0

type Attachment struct {
	Kind     string         `bson:"kind"`
	Metadata map[string]any `bson:"metadata"`
}

type Conversation

type Conversation struct {
	ID           bson.ObjectID  `bson:"_id"`
	Participants []Participant  `bson:"participants"`
	Metadata     map[string]any `bson:"metadata"`
	LastMessage  *Message       `bson:"last_message"`
	CreatedAt    time.Time      `bson:"created_at"`
	UpdatedAt    time.Time      `bson:"updated_at"`
}

type Message

type Message struct {
	ID             bson.ObjectID `bson:"_id"`
	ConversationID bson.ObjectID `bson:"conversation_id"`
	Sender         MessageSender `bson:"sender"`
	Kind           string        `bson:"kind"`
	Content        string        `bson:"content,omitempty"`
	Attachments    []Attachment  `bson:"attachments"`
	Reactions      []Reaction    `bson:"reactions"`
	CreatedAt      time.Time     `bson:"created_at"`
}

type MessageSender

type MessageSender struct {
	ParticipantID string         `bson:"participant_id"`
	Metadata      map[string]any `bson:"metadata"`
}

type Participant

type Participant struct {
	ParticipantID     string         `bson:"participant_id"`
	Metadata          map[string]any `bson:"metadata"`
	DeletedAt         *time.Time     `bson:"deleted_at"`
	LastReadMessageID *bson.ObjectID `bson:"last_read_message_id"`
	LastReadAt        *time.Time     `bson:"last_read_at"`
}

type Reaction

type Reaction struct {
	Emoji        string                `bson:"emoji"`
	Participants []ReactionParticipant `bson:"participants"`
}

type ReactionParticipant

type ReactionParticipant struct {
	ParticipantID string         `bson:"participant_id"`
	Metadata      map[string]any `bson:"metadata"`
}

Jump to

Keyboard shortcuts

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