message

package
v0.0.0-...-2563dae Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageMongo

type MessageMongo struct {
	Sender  string `bson:"sender"`
	Content string `bson:"content"`
}

type MongoRepository

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

func New

func New(ctx context.Context, connectionURI string, timeout int) (*MongoRepository, error)

func (*MongoRepository) Add

func (r *MongoRepository) Add(message chat.Message) error

func (*MongoRepository) GetMessages

func (r *MongoRepository) GetMessages(limit int) ([]*MessageMongo, error)

type Repository

type Repository interface {
	GetMessages(limit int) ([]*MessageMongo, error)
	Add(message chat.Message) error
}

Jump to

Keyboard shortcuts

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