models

package
v0.0.0-...-4b14bc7 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 6 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,omitempty" bson:"_id,omitempty"`
	Name        string             `json:"name,omitempty" bson:"name"`
	Email       string             `json:"email,omitempty" bson:"email"`
	Password    string             `json:"password,omitempty" bson:"password"`
	IsActive    bool               `json:"isActive,omitempty" bson:"isActive"`
	LastSession primitive.DateTime `json:"lastSession,omitempty" bson:"lastSession"`
}

User represent the entity of Users, as json response or entity for the database

func (*User) CreateJWT

func (u *User) CreateJWT() (string, error)

CreateJWT Generate a Json Web Token, with the name and email of the struct

func (*User) ValidateToCreate

func (u *User) ValidateToCreate() error

ValidateToCreate validate if the information of the struct have the enough and correct data for been stored

func (*User) ValidateToUpdate

func (u *User) ValidateToUpdate() error

ValidateToUpdate validate if the information of the struct have the enough and correc data for been updated

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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