inbox

package
v0.0.0-...-31ad618 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Send

func Send(q db.Q, sender, recipient user.ID, title, body string) error

Types

type ID

type ID = int

type Inbox

type Inbox struct {
	AllCount    int
	UnreadCount int
	SentCount   int
	// contains filtered or unexported fields
}

func Of

func Of(q db.Q, userID user.ID) (inbox Inbox, err error)

func (Inbox) All

func (inbox Inbox) All(q db.Q) (Messages, error)

func (Inbox) Sent

func (inbox Inbox) Sent(q db.Q) (Messages, error)

func (Inbox) Unread

func (inbox Inbox) Unread(q db.Q) (Messages, error)

type Message

type Message struct {
	ID        ID
	Sender    user.User
	Recipient user.User

	Title string
	Body  string

	Date timestamp.Timestamp
}

func MessageByID

func MessageByID(q db.Q, id ID) (Message, error)

func (Message) MarkRead

func (m Message) MarkRead(q db.Q) error

type Messages

type Messages []Message

Jump to

Keyboard shortcuts

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