mongo

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Mongo implements the repository.Group interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoRepository

type MongoRepository struct {
	ProjectCol  *mongo.Collection
	SettingsCol *mongo.Collection
}

func NewRepository

func NewRepository(c *mongo.Client) (*MongoRepository, error)

func (*MongoRepository) BuildIndexes

func (r *MongoRepository) BuildIndexes(ctx context.Context) error

BuildIndexes TODO: implement.

func (*MongoRepository) Create

func (c *MongoRepository) Create(ctx context.Context, project *project.Project) (*project.Project, error)

Create inserts a model.Project in the database with default fields and returns the created object.

func (*MongoRepository) Delete

func (c *MongoRepository) Delete(ctx context.Context, projectID uuid.UUID) error

Delete removes the project (document) from the database.

func (*MongoRepository) Get

func (c *MongoRepository) Get(ctx context.Context, projectId uuid.UUID) (*project.Project, error)

Get returns the requested Project (document) from the database.

func (*MongoRepository) GetSettings

func (m *MongoRepository) GetSettings(ctx context.Context, projectID uuid.UUID, settingsName string) ([]byte, error)

func (*MongoRepository) List

func (r *MongoRepository) List(ctx context.Context, pagination *model.Pagination, exclude []uuid.UUID) (iterator.Iterator[*project.Project], int64, error)

func (*MongoRepository) SetSettings

func (m *MongoRepository) SetSettings(ctx context.Context, projectID uuid.UUID, settingsName string, data []byte) error

func (*MongoRepository) Update

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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