options

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ScopesPaginate

func ScopesPaginate(o *Option) func(db *gorm.DB) *gorm.DB

Types

type Opt

type Opt func(*Option)

func WithArgs

func WithArgs(args ...any) Opt

func WithPaginate

func WithPaginate(page, size int) Opt

func WithQuery

func WithQuery(query any) Opt

func WithUnscoped

func WithUnscoped() Opt

func WithWhere

func WithWhere(query any, args ...any) Opt

type Option

type Option struct {
	Where
	Paginate

	Unscoped bool
}

type Paginate

type Paginate struct {
	Page     int
	PageSize int
}

type Where

type Where struct {
	Query any
	Args  []any
}

Jump to

Keyboard shortcuts

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