mongo

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ObjectMongoRepository

type ObjectMongoRepository struct {
	db.ObjectRepository
	// contains filtered or unexported fields
}

ObjectMongoRepository implementations of db.ObjectRepository for MongoDb repo

func NewObjectMongoRepository

func NewObjectMongoRepository(logger logger.Logger, db *intMongo.Db) *ObjectMongoRepository

NewObjectMongoRepository creates new instance of ObjectMongoRepository

func (*ObjectMongoRepository) Create

func (store *ObjectMongoRepository) Create(ctx context.Context, obj data.Object) error

Create persist new data.Object in MongoDB

func (*ObjectMongoRepository) Delete

Delete removes object in mongo database

func (*ObjectMongoRepository) Exists

func (store *ObjectMongoRepository) Exists(ctx context.Context, ns data.Namespace, id data.ObjectID) (bool, error)

Exists checks if data.Object exists in mongo database

func (*ObjectMongoRepository) Find

Find looking up data.Object in database

func (*ObjectMongoRepository) FindAllByStatus

func (store *ObjectMongoRepository) FindAllByStatus(ctx context.Context, status data.ObjectStatus) ([]data.Object, error)

FindAllByStatus returns all object with specific status

func (*ObjectMongoRepository) IsUploaded

func (store *ObjectMongoRepository) IsUploaded(ctx context.Context, ns data.Namespace, id data.ObjectID) (bool, error)

IsUploaded checks if data.Object was data.Uploaded

func (*ObjectMongoRepository) SetCompleted

func (store *ObjectMongoRepository) SetCompleted(ctx context.Context, ns data.Namespace, id data.ObjectID) error

SetCompleted change data.Object status to data.Uploaded

func (*ObjectMongoRepository) Update

func (store *ObjectMongoRepository) Update(ctx context.Context, ns data.Namespace, id data.ObjectID, size int64, status data.ObjectStatus) error

Update change data.Object properties

func (*ObjectMongoRepository) Usage

func (store *ObjectMongoRepository) Usage(ctx context.Context, ns data.Namespace) (int64, error)

Usage returns space used by data.Namespace

type RefMongoRepository

type RefMongoRepository struct {
	db.RefRepository
	// contains filtered or unexported fields
}

RefMongoRepository implementations of db.RefRepository for MongoDb repo

func NewRefMongoRepository

func NewRefMongoRepository(logger logger.Logger, db *intMongo.Db) *RefMongoRepository

NewRefMongoRepository creates new instance of RefMongoRepository

func (*RefMongoRepository) Create

func (store *RefMongoRepository) Create(ctx context.Context, ref data.Ref) error

Create persist new data.Ref in MongoDB

func (*RefMongoRepository) Delete

func (store *RefMongoRepository) Delete(ctx context.Context, ns data.Namespace, name data.RefName) error

Delete removes data.Ref from mongo database

func (*RefMongoRepository) Exists

func (store *RefMongoRepository) Exists(ctx context.Context, ns data.Namespace, name data.RefName) (bool, error)

Exists checks if data.Object exists in mongo database

func (*RefMongoRepository) Find

func (store *RefMongoRepository) Find(ctx context.Context, ns data.Namespace, name data.RefName) (*data.Ref, error)

Find looking up data.Ref in database

func (*RefMongoRepository) Update

func (store *RefMongoRepository) Update(ctx context.Context, ref data.Ref) error

Update change data.Ref properties

Jump to

Keyboard shortcuts

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