where

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewAction

func NewAction() map[string]Hooks

*@Author Administrator *@Date 22/4/2021 10:06 *@desc

func OptionWhereInit added in v1.0.20

func OptionWhereInit(db *gorm.DB, i interface{}) *gorm.DB

func Order

func Order(dbs *gorm.DB, order map[string]interface{}, orderString string) *gorm.DB

func RegsterHooks

func RegsterHooks(options ...ResiterHooksOption)

Types

type Action

type Action struct {
}

func (*Action) Common

func (a *Action) Common(char string) Hooks

func (*Action) ContainIn

func (a *Action) ContainIn(char string) Hooks

func (*Action) ContainNull

func (a *Action) ContainNull(char string) Hooks

func (*Action) ContainOr

func (a *Action) ContainOr() Hooks

func (*Action) Init

func (a *Action) Init() map[string]Hooks

func (*Action) Like

func (a *Action) Like() Hooks

type Grom

type Grom struct {
	Hooks      []Hooks
	HooksList  map[string]Hooks
	WhereList  []string
	HooksWhere map[string]HooksWhere
}

func (*Grom) ResiterAction

func (g *Grom) ResiterAction(where string, hk HooksWhere)

func (*Grom) ResiterHooks

func (g *Grom) ResiterHooks(where string, hk Hooks)

*@Author Administrator *@Date 21/4/2021 13:22 *@desc

func (*Grom) SeparatorDefualt

func (g *Grom) SeparatorDefualt(option *HooksOption) bool

func (*Grom) Where

func (g *Grom) Where(db *gorm.DB, i interface{}) *gorm.DB

func (*Grom) WhereAction

func (g *Grom) WhereAction(option *HooksOption) bool

func (*Grom) WhereSeparator

func (g *Grom) WhereSeparator(option *HooksOption) *gorm.DB

type GromInterface

type GromInterface interface {
	ResiterHooks(where string, hk Hooks)
	ResiterAction(where string, hk HooksWhere)
	Where(db *gorm.DB, i interface{}) *gorm.DB
}

func NewGorm

func NewGorm() GromInterface

type Hooks

type Hooks func(option *HooksOption) *gorm.DB

type HooksOption

type HooksOption struct {
	Field       string
	Default     string
	Where       string
	StructField reflect.StructField
	Value       reflect.Value
	DB          *gorm.DB
}

type HooksWhere

type HooksWhere func(option *HooksOption) bool

type ResiterHooksOption

type ResiterHooksOption struct {
	Hooks  Hooks
	Action HooksWhere
	Where  string
}

Jump to

Keyboard shortcuts

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