users

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	USERS_COLLECTION = "users"
	SERVICE_NAME     = "gapi_users"
	PAGE_LENGTH      = 10
)

Variables

View Source
var UsersList []User

Functions

func CreateUser

func CreateUser(user User) error

func GeneratePassword

func GeneratePassword(password string) ([]byte, error)

func InitUsers

func InitUsers()

func UpdateUser

func UpdateUser(user User) error

Types

type User

type User struct {
	Id       bson.ObjectId `bson:"_id" json:"Id"`
	Username string
	Password string `json:",omitempty"`
	Email    string
	IsAdmin  bool
}

func FindUsersByUsernameOrEmail

func FindUsersByUsernameOrEmail(q string, page int) []User

func GetUserByUsername

func GetUserByUsername(username string) []User

Jump to

Keyboard shortcuts

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