model

package
v0.0.0-...-2a97ad4 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const UserCollectionName = "users"

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Email    string `json:"Email" validate:"email"`
	Password string `json:"Password" validate:"required"`
	Phone    uint   `json:"Phone" validate:"required"`
	Token    string `json:"Token"`
	Role     Role   `json:"Role"`
	Verified bool   `json:"Verified"`
}

type Error

type Error struct {
	FailedField string `json:"FailedField"`
	Tag         string `json:"Tag"`
	Value       string `json:"Value"`
}

type Response

type Response struct {
	Status  int         `json:"Status"`
	Message string      `json:"Message"`
	Data    interface{} `json:"Data"`
}

type Role

type Role string
var (
	ADMIN Role = "admin"
	USER  Role = "user"
)

type User

type User struct {
	Id        primitive.ObjectID `json:"Id" bson:"_id,omitempty"`
	Name      string             `json:"Name" validate:"required"`
	Account   Account            `json:"Account" validate:"required"`
	CreatedAt time.Time          `json:"CreatedAt"`
	UpdatedAt time.Time          `json:"UpdatedAt"`
}

type Users

type Users []User

Jump to

Keyboard shortcuts

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