db

package
v0.0.0-...-38f6076 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2022 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection interface {
	DeleteOne(c string, d interface{}) (*mongo.DeleteResult, error)
	Distinct(c string, q string, f interface{}) ([]interface{}, error)
	FindAll(c string, q bson.M, o ...*options.FindOptions) ([]bson.M, error)
	FindOne(c string, q bson.M, r interface{}) error
	InsertOne(c string, d interface{}) (*mongo.InsertOneResult, error)
	Ping() error
	UpdateOne(c string, f, d interface{}) (*mongo.UpdateResult, error)
}

type DB

type DB interface {
	Create(d wallet.Queryable) (*mongo.InsertOneResult, error)
	Delete(collectionName, id string) (*mongo.DeleteResult, error)
	Get(id string, d wallet.Queryable) error
	GetAll(q wallet.Queryable) ([]wallet.Queryable, error)
	GetBySlug(slug string, d wallet.Queryable) error
	Update(id string, d wallet.Queryable) (*mongo.UpdateResult, error)

	GetPortfolioData(p *wallet.Portfolio, year int) error
	GetAllOperations() (interface{}, error)
	GetAllPurchases() (interface{}, error)
	GetAllSales() (interface{}, error)

	Ping() error
}

func NewMongoSession

func NewMongoSession() (DB, error)

Jump to

Keyboard shortcuts

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