message

package
v0.0.0-...-1d800d4 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const MaxMessageLength = 10 * 1024

Variables

View Source
var (
	ErrNoContentProvided = &errors.ValidationError{Msg: "no content provided"}
	ErrContentTooLong    = &errors.ValidationError{
		Msg: "content too long (> 10240 bytes)",
	}
)

Functions

This section is empty.

Types

type Manager

type Manager interface {
	GetGlobalMessages(ctx context.Context, projectId sharedTypes.UUID, limit int64, before sharedTypes.Timestamp, target *[]Message) error
	SendGlobalMessage(ctx context.Context, projectId sharedTypes.UUID, msg *Message) error
}

func New

func New(db *pgxpool.Pool) Manager

type Message

type Message struct {
	Id        sharedTypes.UUID                    `json:"id"`
	Content   string                              `json:"content"`
	CreatedAt time.Time                           `json:"timestamp"`
	User      user.WithPublicInfoAndNonStandardId `json:"user,omitempty"`
}

Jump to

Keyboard shortcuts

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