users

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2019 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Users

type Users struct {
	DBName string
	// contains filtered or unexported fields
}

Users is used to handle user data

func (Users) Activate added in v0.3.0

func (users Users) Activate(email string) string

Activate is used to mark an account as active

func (Users) Add

func (users Users) Add(
	mainData config.UserMain, extraData config.UserExtra) (string, string)

Add is used to add user to database

func (Users) Auth

func (users Users) Auth(username, email, password string) (bool, string, string)

Auth is used to authenticate a user

func (Users) Delete

func (users Users) Delete(userID, username, password string) string

Delete is used to mark a user as deleted

func (Users) Disconnect

func (users Users) Disconnect()

Disconnect is used to disconnect from the mongodb

func (Users) Get

func (users Users) Get(userID, collectionName string, data interface{}) error

Get is used to get user's data

func (Users) GetByUsernameOrEmail

func (users Users) GetByUsernameOrEmail(username, email string) (config.UserMain, string)

GetByUsernameOrEmail is used to get user based on username or email

func (*Users) Init

func (users *Users) Init()

Init is used to initialize users struct

func (Users) Update

func (users Users) Update(userID string, update interface{}, collectionName string)

Update is used to update users data in any collection

Jump to

Keyboard shortcuts

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