models

package
v0.0.0-...-80fd6f0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiUser

type ApiUser struct {
	UId   uint   `gorm:"primary key" json:"uid"`
	Email string `gorm:"type:varchar(100);unique_index" json:"email"`
	Name  string `gorm:"size:100;not null"              json:"name"`
}

type Blog

type Blog struct {
	gorm.Model
	Author ApiUser `gorm:"embedded"`
	Title  string  `gorm:"type:varchar(1000);not null" json:"title"`
	Body   string  `gorm:"size:1000;not null" json:"body"`
}

func (*Blog) Get

func (b *Blog) Get(id int, db *gorm.DB) (*Blog, error)

func (*Blog) GetAll

func (b *Blog) GetAll(db *gorm.DB) (*[]Blog, error)

func (*Blog) GetAllFromUser

func (b *Blog) GetAllFromUser(db *gorm.DB) (*[]Blog, error)

func (*Blog) Prepare

func (b *Blog) Prepare()

func (*Blog) Put

func (b *Blog) Put(id int, db *gorm.DB) (*Blog, error)

func (*Blog) Save

func (b *Blog) Save(db *gorm.DB) (*Blog, error)

Jump to

Keyboard shortcuts

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