gorm

package
v0.0.0-...-bb7732e Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CleanCacheFromTag func(ctx context.Context, tag string) error

Functions

This section is empty.

Types

type ActionHook

type ActionHook func(ctx *gin.Context, db *gorm.DB, m schema.Tabler) error

type Control

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

Control action

func NewControl

func NewControl(opts ...Option) *Control

NewControl new control action

func (*Control) Handler

func (e *Control) Handler() gin.HandlersChain

func (*Control) String

func (*Control) String() string

String action name

type Delete

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

Delete action

func NewDelete

func NewDelete(opts ...Option) *Delete

NewDelete new delete action

func (*Delete) Handler

func (e *Delete) Handler() gin.HandlersChain

func (*Delete) String

func (*Delete) String() string

String action name

type Get

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

Get action

func NewGet

func NewGet(opts ...Option) *Get

NewGet new get action

func (*Get) Handler

func (e *Get) Handler() gin.HandlersChain

func (*Get) String

func (*Get) String() string

String action name

type Option

type Option func(*Options)

func WithAfterCreate

func WithAfterCreate(hook ActionHook) Option

func WithAfterDelete

func WithAfterDelete(hook ActionHook) Option

func WithAfterGet

func WithAfterGet(hook ActionHook) Option

func WithAfterSearch

func WithAfterSearch(hook ActionHook) Option

func WithAfterUpdate

func WithAfterUpdate(hook ActionHook) Option

func WithBeforeCreate

func WithBeforeCreate(hook ActionHook) Option

func WithBeforeDelete

func WithBeforeDelete(hook ActionHook) Option

func WithBeforeGet

func WithBeforeGet(hook ActionHook) Option

func WithBeforeSearch

func WithBeforeSearch(hook ActionHook) Option

func WithBeforeUpdate

func WithBeforeUpdate(hook ActionHook) Option

func WithControlHandlers

func WithControlHandlers(handlers gin.HandlersChain) Option

func WithDeleteHandlers

func WithDeleteHandlers(handlers gin.HandlersChain) Option

func WithDepth

func WithDepth(depth int) Option

func WithGetHandlers

func WithGetHandlers(handlers gin.HandlersChain) Option

func WithHandlers

func WithHandlers(handlers gin.HandlersChain) Option

func WithKey

func WithKey(key string) Option

func WithModel

func WithModel(m schema.Tabler) Option

func WithScope

func WithScope(scope func(ctx *gin.Context, table schema.Tabler) func(db *gorm.DB) *gorm.DB) Option

func WithSearch

func WithSearch(search response.Searcher) Option

func WithSearchHandlers

func WithSearchHandlers(handlers gin.HandlersChain) Option

func WithTreeField

func WithTreeField(treeField string) Option

type Options

type Options struct {
	Model        schema.Tabler
	Scope        func(ctx *gin.Context, table schema.Tabler) func(db *gorm.DB) *gorm.DB
	TreeField    string
	Depth        int
	Key          string
	Search       response.Searcher
	BeforeCreate ActionHook
	AfterCreate  ActionHook
	BeforeUpdate ActionHook
	AfterUpdate  ActionHook
	BeforeGet    ActionHook
	AfterGet     ActionHook
	BeforeDelete ActionHook
	AfterDelete  ActionHook
	BeforeSearch ActionHook
	AfterSearch  ActionHook
	// contains filtered or unexported fields
}
type Search struct {
	// contains filtered or unexported fields
}

Search action

func NewSearch

func NewSearch(opts ...Option) *Search

NewSearch new search action

func (*Search) Handler

func (e *Search) Handler() gin.HandlersChain

Handler action handler

func (*Search) String

func (*Search) String() string

String action name

Jump to

Keyboard shortcuts

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