model

package
v0.0.0-...-26c603c Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package model gorm's model

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cat

type Cat struct {
	Pure       `gorm:"embedded"`
	Name       string   `json:"name"`
	Color      string   `json:"color"`
	CategoryID string   `json:"category_id"`
	Category   Category `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" json:"category"`
}

Cat cat model struct

func (*Cat) TableName

func (cat *Cat) TableName() string

TableName get table name

type Category

type Category struct {
	Pure `gorm:"embedded"`
	Name string `json:"name"`
	Cats []Cat  `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" json:"cats"`
}

Category category model struct

func (*Category) TableName

func (category *Category) TableName() string

TableName get table name

type Pure

type Pure struct {
	ID        uuid.UUID      `gorm:"primary_key;type:uuid;default:uuid_generate_v4()" json:"id"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
}

Pure pure/base model

Jump to

Keyboard shortcuts

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