api

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2019 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ApiSignQueryNames = []string{"t", "nonce"}

Functions

func JumpToApiError

func JumpToApiError(context gcontroller.ActionContext, args ...interface{})

func SetApiSignParams

func SetApiSignParams(qs *query.QuerySet, asp *ApiSignParams)

func VerifyApiSign

func VerifyApiSign(asp *ApiSignParams, queryValues url.Values, signQueryNames []string, token string) *exception.Exception

Types

type ApiContext

type ApiContext struct {
	*controller.BaseContext

	ApiData struct {
		V    string
		Data interface{}
		Err  *exception.Exception
	}

	MysqlClient *mysql.Client

	RedisPool   *redis.Pool
	RedisClient *redis.Client

	MongoPool   *mongo.Pool
	MongoClient *mongo.Client
	MongoLogger golog.ILogger
}

func (*ApiContext) AfterAction

func (a *ApiContext) AfterAction()

func (*ApiContext) BeforeAction

func (a *ApiContext) BeforeAction()

func (*ApiContext) Data

func (a *ApiContext) Data() interface{}

func (*ApiContext) Destruct

func (a *ApiContext) Destruct()

func (*ApiContext) Err

func (a *ApiContext) Err() *exception.Exception

func (*ApiContext) Version

func (a *ApiContext) Version() string

type ApiSignParams

type ApiSignParams struct {
	T     int64
	Nonce string
	Sign  string
	Debug int
}

type BaseController

type BaseController struct {
	controller.BaseController
}

func (*BaseController) NewActionContext

func (b *BaseController) NewActionContext(req *http.Request, respWriter http.ResponseWriter) gcontroller.ActionContext

type IApiDataContext

type IApiDataContext interface {
	gcontroller.ActionContext

	Version() string
	Data() interface{}
	Err() *exception.Exception
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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