models

package
v0.0.0-...-0296064 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2019 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 Author

type Author struct {
	gorm.Model
	Name    string `gorm:"type:varchar(128);not null"`
	Email   string `gorm:"type:varchar(128);unique;not null"`
	Phone   string `gorm:"type:varchar(32)"`
	Age     float64
	Address string `gorm:"type:varchar(256)"`
}

func (Author) ToMap

func (author Author) ToMap() map[string]interface{}

func (Author) ToSlice

func (author Author) ToSlice() []interface{}

type Book

type Book struct {
	gorm.Model
	Name      string `gorm:"type:varchar(128);not null"`
	ISBN      string `gorm:"type:varchar(64);unique;not null"`
	Author    Author `gorm:"foreignkey:Author_id"`
	Author_id uint
}

Jump to

Keyboard shortcuts

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