repository

package
v0.0.0-...-7b8267f Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultStoragePath = "../db-data/filestore"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FileMessageRepository

type FileMessageRepository[T model.Message] struct {
	// contains filtered or unexported fields
}

func NewFileMessageRepository

func NewFileMessageRepository() *FileMessageRepository[model.Message]

func (*FileMessageRepository[T]) FindByTopic

func (r *FileMessageRepository[T]) FindByTopic(topic string) ([]model.Message, error)

func (*FileMessageRepository[T]) Insert

func (r *FileMessageRepository[T]) Insert(message model.Message) error

type MongoMessageRepository

type MongoMessageRepository[T model.Message] struct {
	// contains filtered or unexported fields
}

func NewMongoMessageRepository

func NewMongoMessageRepository(client *mongo.Client) *MongoMessageRepository[model.Message]

func (*MongoMessageRepository[T]) FindByTopic

func (r *MongoMessageRepository[T]) FindByTopic(topic string) ([]model.Message, error)

func (*MongoMessageRepository[T]) Insert

func (r *MongoMessageRepository[T]) Insert(message model.Message) error

type Repository

type Repository[T any] interface {
	Insert(t T) error
	FindByTopic(topic string) ([]T, error)
}

Jump to

Keyboard shortcuts

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