ixmongodb

package
v0.0.0-...-3efca3f Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoDB

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

func New

func New(url, database string) (*MongoDB, error)

func (*MongoDB) ActivateUser

func (m *MongoDB) ActivateUser(id, token string) error

ActivateUser activates a user, based on a provided activation token

func (*MongoDB) Add

func (m *MongoDB) Add(i interface{}) (string, error)

Add writes a user record to the database

func (*MongoDB) AddToken

func (m *MongoDB) AddToken(id string, tokens ...string) error

AddToken adds a token or tokens to an existing user ID

func (*MongoDB) CreateUser

func (m *MongoDB) CreateUser(username, firstname, lastname, email, passwordSalt, passwordHash, activationToken string) error

CreateUser adds a new user to the database with no rights, and not activated yet

func (*MongoDB) Get

func (m *MongoDB) Get(filter bson.M) (*models.User, error)

Get executes a get of 1 object, and returns one result

func (*MongoDB) GetByEmail

func (m *MongoDB) GetByEmail(email string) (*models.User, error)

GetByEmail returns a user model based on a provided email

func (*MongoDB) GetByID

func (m *MongoDB) GetByID(id string) (*models.User, error)

GetByID returns a user model based on a provided user id

func (*MongoDB) GetByUsername

func (m *MongoDB) GetByUsername(username string) (*models.User, error)

GetByUsername returns a user model based on a provided username

func (*MongoDB) SetStorageLimit

func (m *MongoDB) SetStorageLimit(id string, limitByte int64) error

SetStorageLimit sets the storage limit object to a specific user

func (*MongoDB) UpdateOne

func (m *MongoDB) UpdateOne(filter, update bson.M) error

UpdateOne updates a single item in a record on mongo

Jump to

Keyboard shortcuts

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