models

package
v0.0.0-...-7740740 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Potato

type Potato struct {
	ID          uint64    `gorm:"primary_key;auto_increment" json:"id"`
	Name        string    `gorm:"size:255;not null;unique" json:"name"`
	Description string    `gorm:"size:255;not null;" json:"description"`
	CreatedAt   time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt   time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`
}

func (*Potato) DeleteAPotato

func (p *Potato) DeleteAPotato(db *gorm.DB, pid uint64) (int64, error)

func (*Potato) FindAllPotatoes

func (p *Potato) FindAllPotatoes(db *gorm.DB) (*[]Potato, error)

func (*Potato) FindPotatoByID

func (p *Potato) FindPotatoByID(db *gorm.DB, pid uint64) (*Potato, error)

func (*Potato) Prepare

func (p *Potato) Prepare()

func (*Potato) SavePotato

func (p *Potato) SavePotato(db *gorm.DB) (*Potato, error)

func (*Potato) UpdateAPotato

func (p *Potato) UpdateAPotato(db *gorm.DB) (*Potato, error)

Jump to

Keyboard shortcuts

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