database

package
v0.0.0-...-9519e4a Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Unlicense Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMD5Hash

func GetMD5Hash(text string) string

Types

type DBWrapper

type DBWrapper struct {
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase() *DBWrapper

func (*DBWrapper) Login

func (d *DBWrapper) Login(name, pass string) (*entities.User, error)

func (*DBWrapper) Logout

func (d *DBWrapper) Logout(_hexid string) error

func (*DBWrapper) Register

func (d *DBWrapper) Register(email, pass, name string) (*entities.User, error)

type MongoDBWrapper

type MongoDBWrapper struct {
	// contains filtered or unexported fields
}

func NewMongoDBWrapper

func NewMongoDBWrapper(uri string, poolSize uint64) *MongoDBWrapper

func (*MongoDBWrapper) Close

func (wrapper *MongoDBWrapper) Close()

func (*MongoDBWrapper) CreateDocument

func (wrapper *MongoDBWrapper) CreateDocument(database, collection string, document interface{}) (*mongo.InsertOneResult, error)

func (*MongoDBWrapper) CreateDocuments

func (wrapper *MongoDBWrapper) CreateDocuments(database, collection string, documents []interface{}) (*mongo.InsertManyResult, error)

func (*MongoDBWrapper) Exists

func (wrapper *MongoDBWrapper) Exists(database, collection string, filter interface{}) int64

func (*MongoDBWrapper) GetDocument

func (wrapper *MongoDBWrapper) GetDocument(database, collection string, filter interface{}) (*mongo.SingleResult, error)

func (*MongoDBWrapper) GetDocumentWithUpdate

func (wrapper *MongoDBWrapper) GetDocumentWithUpdate(database, collection string, filter interface{}, update interface{}) (*mongo.SingleResult, error)

func (*MongoDBWrapper) GetDocuments

func (wrapper *MongoDBWrapper) GetDocuments(database, collection string, filter interface{}) (*mongo.Cursor, error)

func (*MongoDBWrapper) UpdateDocument

func (wrapper *MongoDBWrapper) UpdateDocument(database, collection string, filter, update interface{}) (*mongo.UpdateResult, error)

func (*MongoDBWrapper) UpdateDocuments

func (wrapper *MongoDBWrapper) UpdateDocuments(database, collection string, filter, update interface{}) (*mongo.UpdateResult, error)

Jump to

Keyboard shortcuts

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