models

package
v0.0.0-...-486f8e0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chat

type Chat struct {
	ID        primitive.ObjectID `bson:"_id"`
	PassKey   string             `bson:"passkey, omitempty"`
	Name      string             `bson:"name, omitempty"`
	Type      pb.ChatType        `bson:"type"`
	CreatedAt time.Time          `bson:"created_at"`
	Members   []User             `bson:"members"`
	Messages  []Message          `bson:"messages"`
}

func (Chat) GetID

func (c Chat) GetID() string

type DirectChatRequest

type DirectChatRequest struct {
	ID        primitive.ObjectID `bson:"_id"`
	Sender    User               `bson:"sender"`
	Receiver  User               `bson:"receiver"`
	CreatedAt time.Time          `bson:"created_at"`
}

func (DirectChatRequest) GetID

func (d DirectChatRequest) GetID() string

type Message

type Message struct {
	ID        primitive.ObjectID     `bson:"_id"`
	Sender    User                   `bson:"sender"`
	Content   string                 `bson:"content"`
	Type      pb.Message_MessageType `bson:"type"`
	CreatedAt time.Time              `bson:"created_at"`
}

func (Message) GetID

func (m Message) GetID() string

type Modeler

type Modeler interface {
	GetID() string
}

type User

type User struct {
	ID           primitive.ObjectID `bson:"_id"`
	Username     string             `bson:"username"`
	PasswordHash string             `bson:"password_hash,omitempty"`
}

func (User) GetID

func (u User) GetID() string

Jump to

Keyboard shortcuts

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