helper

package
v3.14.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUser

func GetUser(c *gin.Context) (user uic.User, err error)

func JSONR

func JSONR(c *gin.Context, arg ...interface{}) (werror error)

func JSONR(c *gin.Context, wcode int, msg interface{}) (werror error) {

func PageParser

func PageParser(page string, limit string) (p int, l int, err error)

func SessionChecking

func SessionChecking(c *gin.Context) (auth bool, isServiceToken bool, err error)

Types

type DataWaper

type DataWaper struct {
	Data interface{} `json:"data,omitempty"`
	Page interface{} `json:"page,omitempty"`
	Msg  string      `json:"message,omitempty"`
}

type FilterBy

type FilterBy struct {
	Q string `json:"q" form:"q"`
}

func (FilterBy) FilterLike

func (self FilterBy) FilterLike(q *gorm.DB, feildName string) (qt *gorm.DB)

func (FilterBy) FilterRegexp

func (self FilterBy) FilterRegexp(q *gorm.DB, feildName string) (qt *gorm.DB)

type Params

type Params struct {
}

func (Params) GetInt

func (Params) GetInt(params gin.Params, name string) (*int, error)

func (Params) GetString

func (Params) GetString(params gin.Params, name string) (*string, error)

type RespJson

type RespJson struct {
	Error string `json:"error,omitempty"`
	Msg   string `json:"message,omitempty"`
}

type SortByHelpr

type SortByHelpr struct {
	OrderBy string `json:"order_by" form:"order_by"`
}

func (SortByHelpr) OrderBySql

func (self SortByHelpr) OrderBySql(q *gorm.DB) (qt *gorm.DB)

type WebSession

type WebSession struct {
	Name string
	Sig  string
}

func GetSession

func GetSession(c *gin.Context) (session WebSession, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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