models

package
v0.0.0-...-0e580d0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateCustomer

func ValidateCustomer(customerForm *CustomerForm) error

ValidateCustomer takes a user as parameter and check if its properties are valid

Types

type Customer

type Customer struct {
	ID             string `gorm:"primary_key"`
	Name           string `gorm:"size:255"`
	Email          string `gorm:"size:255; unique"`
	HashedPassword string
	Role           string `gorm:"size:255"`
}

Customer type is the structure of the users that we will store in the database

type CustomerForm

type CustomerForm struct {
	Name     string `gorm:"size:255"`
	Email    string `gorm:"size:255"`
	Password string `gorm:"size:255"`
	Role     string `gorm:"size:255"`
}

CustomerForm is the struct used to login or register

type Fact

type Fact struct {
	ID          int    `json:"id"`
	Description string `json:"description"`
	Author      string `json:"author"`
}

Jump to

Keyboard shortcuts

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