page

package
v0.0.0-...-5699c4c Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: Apache-2.0, Apache-2.0 Imports: 2 Imported by: 0

README

page xorm gorm mgo

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, driver Page)

Register curd

Types

type Page

type Page interface {
	New(db interface{}) Page
	Opt(opt *options.Options) Page                     //分页大小,页数,排序
	Where(query interface{}, args ...interface{}) Page //设置查询参数
	Select(columns ...string) Page                     //查询字段
	Page(data interface{}) (Result, error)             //执行结果
}

func New

func New(name string, db interface{}) Page

type Result

type Result struct {
	Count       int         `json:"count"`
	TotalPage   int         `json:"total_page"`
	CurrentPage int         `json:"current_page"`
	Limit       int         `json:"limit"`
	Records     interface{} `json:"records"`
}

分页返回

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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