persistence

package
v0.0.14-mongodb-client... Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectToMongoDB added in v0.0.14

func ConnectToMongoDB(ctx context.Context, databaseConnected chan struct{}, databaseDisconnected chan struct{}, config MongoDBConfig) (file.FileMetadataRepository, error)

func CreateMongoDBClient

func CreateMongoDBClient(ctx context.Context, uri string) (*mongo.Client, error)

Types

type MongoDBConfig

type MongoDBConfig struct {
	HostUri                string
	DatabaseName           string
	FileMetadataCollection string
}

type MongoDBRepository

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

func NewMongoDBRepository

func NewMongoDBRepository(ctx context.Context, client *mongo.Client, databaseName string, collectionName string) (*MongoDBRepository, error)

func (*MongoDBRepository) StoreFileMetadata added in v0.0.8

func (repository *MongoDBRepository) StoreFileMetadata(ctx context.Context, fileMetadata file.FileMetadata) error

Jump to

Keyboard shortcuts

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