actions

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model interface {
	mgm.Model
	schema.Tabler
}

Model gorm and mgm model

type ModelGorm

type ModelGorm struct {
	// ID primary key
	ID string `gorm:"primaryKey;column:id;type:varchar(64);not null;comment:ID" json:"id" bson:"_id,omitempty" form:"id" query:"id"`
	// CreatedAt create time
	CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
	// UpdatedAt update time
	UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
	// DeletedAt delete time soft delete
	DeletedAt gorm.DeletedAt `gorm:"index" bson:"-" json:"-"`
}

ModelGorm model gorm

func (*ModelGorm) BeforeCreate added in v0.0.2

func (e *ModelGorm) BeforeCreate(_ *gorm.DB) (err error)

func (*ModelGorm) GetID

func (e *ModelGorm) GetID() any

GetID get id

func (*ModelGorm) PrepareID

func (e *ModelGorm) PrepareID(_ any) (any, error)

PrepareID prepare id

func (*ModelGorm) SetID

func (e *ModelGorm) SetID(id any)

SetID set id

func (*ModelGorm) TableName

func (e *ModelGorm) TableName() string

TableName return table name

type ModelProvider

type ModelProvider string

ModelProvider model provider

const (
	// ModelProviderMgm mgm model provider
	ModelProviderMgm ModelProvider = "mgm"
	// ModelProviderGorm gorm model provider
	ModelProviderGorm ModelProvider = "gorm"
	ModelProviderK8S  ModelProvider = "k8s"
)

func (ModelProvider) String added in v0.2.1

func (p ModelProvider) String() string

type Pagination

type Pagination struct {
	Page     int64 `form:"page" query:"page"`
	PageSize int64 `form:"pageSize" query:"pageSize"`
}

Pagination pagination params

func (*Pagination) GetPage

func (e *Pagination) GetPage() int64

GetPage get page

func (*Pagination) GetPageSize

func (e *Pagination) GetPageSize() int64

GetPageSize get page size

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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