databases

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	Client    *mongo.Client
	C         *mongo.Database
	Aggregate bool
	// contains filtered or unexported fields
}

func NewDb

func NewDb(uri string, dbname string, transactions bool, findandmodify bool) (*Database, error)

func (*Database) CreateIndexes

func (db *Database) CreateIndexes() error

func (*Database) DoDelivery

func (db *Database) DoDelivery(ctx context.Context, wId int, oCarrierId int, olDeliveryD time.Time, dId int) error

func (*Database) DoNewOrder

func (db *Database) DoNewOrder(
	ctx context.Context,
	w_id int,
	d_id int,
	c_id int,
	o_entry_d time.Time,
	i_ids []int,
	i_w_ids []int,
	i_qtys []int,
) error

func (*Database) DoOrderStatus

func (db *Database) DoOrderStatus(ctx context.Context, wId int, dId int, cId int, cLast string) error

func (*Database) DoPayment

func (db *Database) DoPayment(ctx context.Context, wId int, dId int, hAmount float64, cWId int,
	cDId int, cId int, cLast string, hDate time.Time, badCredit string, cDataLen int) error

func (*Database) DoStockLevelTrx

func (db *Database) DoStockLevelTrx(ctx context.Context, wId int, dId int, threshold int) error

func (*Database) DoTrxRetries

func (db *Database) DoTrxRetries(fn func(ctx context.Context) error, retries int) error

func (*Database) InsertBatch

func (db *Database) InsertBatch(collectionName string, d []interface{}) error

func (*Database) InsertOne

func (db *Database) InsertOne(collectionName string, d interface{}) error

Jump to

Keyboard shortcuts

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