gorm

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 12 Imported by: 1

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 added in v0.1.6

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

type Base

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

Base action

func (*Base) Handler

func (*Base) Handler() gin.HandlersChain

Handler action handler

func (*Base) String

func (*Base) String() string

String string

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 added in v0.1.6

type Option func(*Options)

func WithAfterCreate added in v0.1.6

func WithAfterCreate(hook ActionHook) Option

func WithAfterDelete added in v0.1.6

func WithAfterDelete(hook ActionHook) Option

func WithAfterGet added in v0.1.6

func WithAfterGet(hook ActionHook) Option

func WithAfterSearch added in v0.1.6

func WithAfterSearch(hook ActionHook) Option

func WithAfterUpdate added in v0.1.6

func WithAfterUpdate(hook ActionHook) Option

func WithBeforeCreate added in v0.1.6

func WithBeforeCreate(hook ActionHook) Option

func WithBeforeDelete added in v0.1.6

func WithBeforeDelete(hook ActionHook) Option

func WithBeforeGet added in v0.1.6

func WithBeforeGet(hook ActionHook) Option

func WithBeforeSearch added in v0.1.6

func WithBeforeSearch(hook ActionHook) Option

func WithBeforeUpdate added in v0.1.6

func WithBeforeUpdate(hook ActionHook) Option

func WithControlHandlers added in v0.1.6

func WithControlHandlers(handlers gin.HandlersChain) Option

func WithDeleteHandlers added in v0.1.6

func WithDeleteHandlers(handlers gin.HandlersChain) Option

func WithDepth added in v0.1.6

func WithDepth(depth int) Option

func WithGetHandlers added in v0.1.6

func WithGetHandlers(handlers gin.HandlersChain) Option

func WithHandlers added in v0.1.6

func WithHandlers(handlers gin.HandlersChain) Option

func WithKey added in v0.1.6

func WithKey(key string) Option

func WithModel added in v0.1.6

func WithModel(m schema.Tabler) Option

func WithScope added in v0.1.6

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

func WithSearch added in v0.1.6

func WithSearch(search response.Searcher) Option

func WithSearchHandlers added in v0.1.6

func WithSearchHandlers(handlers gin.HandlersChain) Option

func WithTreeField added in v0.1.6

func WithTreeField(treeField string) Option

type Options added in v0.1.6

type Options struct {
	Model        schema.Tabler
	Scope        func(ctx *gin.Context, table schema.Tabler) func(db *gorm.DB) *gorm.DB
	Handlers     gin.HandlersChain
	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