model

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ASC sortDirection = iota
	DESC
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseModel

type BaseModel struct{}

func (*BaseModel) AfterFind

func (bm *BaseModel) AfterFind(scope *gorm.DB) (err error)

func (*BaseModel) BeforeCreate

func (bm *BaseModel) BeforeCreate(scope *gorm.DB) (err error)

func (*BaseModel) BeforeSave

func (bm *BaseModel) BeforeSave(scope *gorm.DB) (err error)

func (*BaseModel) BeforeUpdate

func (bm *BaseModel) BeforeUpdate(scope *gorm.DB) (err error)

func (*BaseModel) SetTableName

func (bm *BaseModel) SetTableName(tableName string) string

type Filter

type Filter struct {
	Key string
	Op  string
	Val interface{}
}

type Model

type Model gorm.DB

type Modeller

type Modeller interface {
	TableName() string
	Default() interface{}
}

type Pagination

type Pagination struct {
	// contains filtered or unexported fields
}

func (*Pagination) Count

func (p *Pagination) Count() int

func (*Pagination) CurrentPage

func (p *Pagination) CurrentPage() int

func (*Pagination) FirstItem

func (p *Pagination) FirstItem() interface{}

func (*Pagination) ItemArr

func (p *Pagination) ItemArr() interface{}

func (*Pagination) LastItem

func (p *Pagination) LastItem() interface{}

func (*Pagination) LastPage

func (p *Pagination) LastPage() int

func (*Pagination) PerPage

func (p *Pagination) PerPage() int

func (*Pagination) Total

func (p *Pagination) Total() int64

type Sort

type Sort struct {
	Key       string
	Direction sortDirection
}

Jump to

Keyboard shortcuts

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