models

package
v0.0.0-...-8176a8d Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModelProduct

type ModelProduct struct {
	ID          string    `json:"id" gorm:"primary_key"`
	Name        string    `json:"name" gorm:"type:varchar;"`
	Price       string    `json:"price" gorm:"type:varchar;"`
	Description string    `json:"description"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

func (ModelProduct) TableName

func (ModelProduct) TableName() string

type ModelUser

type ModelUser struct {
	ID        string    `json:"id" gorm:"primary_key"`
	Username  string    `json:"username" gorm:"type:varchar;"`
	Email     string    `json:"email" gorm:"type:varchar; unique; not null"`
	Password  string    `json:"password" gorm:"type:varchar; not null"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

func (*ModelUser) BeforeCreate

func (m *ModelUser) BeforeCreate(db *gorm.DB) error

func (*ModelUser) BeforeUpdate

func (m *ModelUser) BeforeUpdate(db *gorm.DB) error

func (ModelUser) TableName

func (ModelUser) TableName() string

Jump to

Keyboard shortcuts

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