mdb

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CHAndPassword

func CHAndPassword(lH string, lS string) bool

CHAndPassword compares a bcrypt hashed password with its possible plaintext equivalent.

func GFromPassword

func GFromPassword(ls string) string

GFromPassword returns the bcrypt hash of the password at the given cost.

Types

type TXDBS

type TXDBS struct {
	DB      *mongo.Database
	Client  *mongo.Client
	Context context.Context
}

TXDBS is a wrapper for the mongo-go-driver.

func Connect

func Connect(connection, dbname string) (*TXDBS, error)

Connect connect to database used by the mongo-go-driver.

func (*TXDBS) AddClient

func (sDB *TXDBS) AddClient(lT *model.Client) *model.Client

AddClient Insert a Client

func (*TXDBS) Close

func (d *TXDBS) Close()

Close closes the connect used by the mongo-go-driver.

func (*TXDBS) CountClient

func (sDB *TXDBS) CountClient() string

CountClient returns the Client counts

func (*TXDBS) DeleteClient

func (sDB *TXDBS) DeleteClient(uid primitive.ObjectID) error

DeleteClient deletes a Client by its id.

func (*TXDBS) GetClient

func (sDB *TXDBS) GetClient() []*model.Client

GetClient returns all Clients.

func (*TXDBS) UpdateClient

func (sDB *TXDBS) UpdateClient(lT *model.Client) *model.Client

UpdateClient updates a Client.

Jump to

Keyboard shortcuts

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