models

package
v0.0.0-...-b27e04f Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID        primitive.ObjectID `json:"id" binding:"omitempty" bson:"_id,omitempty"`
	FirstName string             `json:"firstName" binding:"omitempty" bson:"firstname,omitempty"`
	LastName  string             `json:"lastName" binding:"omitempty" bson:"lastname,omitempty"`
	Age       int                `json:"age,omitempty" binding:"omitempty" bson:"age,omitempty"`
}

User struct

func GetAllUsers

func GetAllUsers() ([]User, error)

GetAllUsers - returns all users from the db

func (*User) CreateUser

func (u *User) CreateUser() error

CreateUser - creates a single user

func (*User) DeleteUser

func (u *User) DeleteUser(id string) error

DeleteUser - deletes one user from the db

func (*User) GetUserByID

func (u *User) GetUserByID(id string) error

GetUserByID - returns a single user from the db

func (*User) UpdateUser

func (u *User) UpdateUser(id string) error

UpdateUser - updates a user

Jump to

Keyboard shortcuts

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