model

package
v0.0.0-...-50d7d3f Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseModel

type BaseModel struct {
	Id        string    `gorm:"type:uuid;primary_key" json:"id"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

func (*BaseModel) BeforeCreate

func (m *BaseModel) BeforeCreate(tx *gorm.DB) error

func (*BaseModel) BeforeUpdate

func (m *BaseModel) BeforeUpdate(tx *gorm.DB) error

func (*BaseModel) GetID

func (m *BaseModel) GetID() string

func (*BaseModel) RevisionKey

func (m *BaseModel) RevisionKey() string

type Model

type Model interface {
	GetID() string
	BeforeCreate(tx *gorm.DB) error
	BeforeUpdate(tx *gorm.DB) error
	RevisionKey() string
}

Jump to

Keyboard shortcuts

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