Discover Packages
github.com/103cuong/go_grpc_postgres_kit
pkg
model
package
Version:
v0.0.0-...-26c603c
Opens a new window with list of versions in this module.
Published: Sep 20, 2020
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package model gorm's model
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
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
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
Source Files
¶
Click to show internal directories.
Click to hide internal directories.