users

package
v0.0.0-...-0370b80 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//DB_NAME is the db name
	DB_NAME = "mydb"
	//USERS_COLLECTION_NAME is the name for the users collection
	USERS_COLLECTION_NAME = "users"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID          string `bson:"_id,omitempty"`
	FirstName   string `json:"first_name"`
	LastName    string `json:"last_name"`
	Email       string `json:"email"`
	DateCreated string `json:"date_created"`
	Status      string `json:"status"`
	Password    string `json:"password"`
}

User is the domain

func (*User) Get

func (user *User) Get() api_errors.RestErr

Get get the user by the ID given

func (*User) Save

func (user *User) Save() api_errors.RestErr

Save save a new user to the users collections

func (*User) Validate

func (user *User) Validate() api_errors.RestErr

Validate validates FirstName, LastName, Email and Password (only for trimspace)

Jump to

Keyboard shortcuts

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