ging

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2020 License: MIT Imports: 17 Imported by: 1

README

ging


ging for gin micro web framework extending

auth: 美丽的地球啊 - mliu

date: 20161001

----- Example -----

+++++ main.go +++++

func main() {

//解析参数
appSettings, appRouter := parseApplication()
if appSettings == nil || appRouter == nil {
    return
}

//引导器初始化
Bootstrap(appSettings)

//启动服务器
serverOption := &ging.ServerOption{
    Host:  appSettings.Server.Host,
    Ports: appSettings.Server.Ports,
}

ging.Start(serverOption, appRouter)

}

func parseApplication() (*ging.Settings, ging.IHttpRouter) {

//解析参数
appNameFlag := flag.String("app", "", "请输入App名称")

appHostFlag := flag.String("host", "", "请输入绑定Ip")

flag.Parse()

//App名称
appName := *appNameFlag

//App设置
appSettingsList := map[string]*ging.Settings{
    "myapp": myapp.AppSettings,
}

appSettings, isOk := appSettingsList[appName]
if !isOk {
    return nil, nil
}

//当前应用名称
appSettings.AppName = appName

//自定义绑定Ip优先
appHost := *appHostFlag
if len(appHost) > 0 {
    appSettings.Server.Host = appHost
} else {
    return nil, nil
}

//App路由
routers := map[string]ging.IHttpRouter{
    "myapp": myapp.NewHttpRouter(),
}

appRouter, isRouterOk := routers[appName]
if !isRouterOk {
    log.Printf("parse application appName: %s isRouter error", appName)
    return nil, nil
}

return appSettings, appRouter

}

----- App -----

+++++ app.go +++++

package myapp

import (

"github.com/gin-gonic/gin"

"github.com/sanxia/ging"

"github.com/sanxia/ging/middleware/authentication/cookie"

"github.com/sanxia/ging/middleware/session"

)

// 创建路由

func NewHttpRouter() ging.IHttpRouter { return &HttpRouter{} }

// Route 路由注册

func (r *HttpRouter) Route() *gin.Engine {

httpEngine := ging.NewHttpEngine(AppSettings.Storage.HtmlTemplate.Path, ging.RELEASE, AppSettings.IsDebug)

//静态路由
httpEngine.Static("/static", "./assets")

//认证中间件
httpEngine.Middleware(cookie.CookieAuthenticationMiddleware(cookie.CookieExtend{
    Option: &cookie.CookieOption{
        Name:     AppSettings.Forms.Authentication.Cookie.Name,
        Path:     AppSettings.Forms.Authentication.Cookie.Path,
        Domain:   AppSettings.Forms.Authentication.Cookie.Domain,
        MaxAge:   AppSettings.Forms.Authentication.Cookie.MaxAge,
        HttpOnly: AppSettings.Forms.Authentication.Cookie.HttpOnly,
        Secure:   AppSettings.Forms.Authentication.Cookie.Secure,
    },
    AuthorizeUrl:   AppSettings.Forms.Authentication.AuthorizeUrl,
    DefaultUrl: AppSettings.Forms.Authentication.DefaultUrl,
    PassUrls:   AppSettings.Forms.Authentication.PassUrls,
    EncryptKey: AppSettings.Security.EncryptKey,
    IsEnabled:  true,
}))

//会话中间件
httpEngine.Middleware(session.SessionMiddleware(&session.SessionOption{
    Cookie: &session.SessionCookieOption{
        Name:     AppSettings.Session.Cookie.Name,
        Path:     AppSettings.Session.Cookie.Path,
        Domain:   AppSettings.Session.Cookie.Domain,
        MaxAge:   AppSettings.Session.Cookie.MaxAge,
        HttpOnly: AppSettings.Session.Cookie.HttpOnly,
        Secure:   AppSettings.Session.Cookie.Secure,
    },
    Redis: &session.SessionRedisOption{
        Host:     AppSettings.Session.RedisStore.Host,
        Port:     AppSettings.Session.RedisStore.Port,
        Password: AppSettings.Session.RedisStore.Password,
        Prefix:   AppSettings.Redis.Prefix,
    },
    EncryptKey: AppSettings.Security.EncryptKey,
    StoreType:  AppSettings.Session.StoreType,
}))

//passport router
passportController := passport.NewController("passport", httpEngine)
passportController.Filter(filter.PassportFilter())
passportController.Get("test", passportController.Test)

//public router
publicController := public.NewController("public", httpEngine)
publicController.Filter(filter.NewTimerFilter(), filter.NewLogFilter())
publicController.Filter(filter.NewAuthorizationFilter(&filter.AuthorizationOption{
    Authorization: app_filter.NewAuthorization(),
    AuthorizeUrl:  AppSettings.Forms.Authentication.AuthorizeUrl,
}))

publicController.Get("test1", publicController.Test)
publicController.Post("test1", publicController.Test)
publicController.Get("test2", publicController.Test, false)

return httpEngine.Engine()

}

Documentation

Index

Constants

View Source
const (
	DEBUG   string = "debug"
	RELEASE string = "release"
)
View Source
const (
	TOKEN_IDENTITY string = "__ging_t__"
)

================================================================================ * Token identity * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

Variables

This section is empty.

Functions

func Bootstrap

func Bootstrap(args ...bootstrapFunc)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * bootstrap * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func IsAjax

func IsAjax(ctx *gin.Context) bool

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * is ajax request * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func RegisterApp

func RegisterApp(args ...IApp) error

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * register app * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func Start

func Start()

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * launch an app * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Types

type ActionHandler

type ActionHandler func(*gin.Context) IActionResult

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * Http请求动作接口 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type ActionResult

type ActionResult struct {
	Context     *gin.Context
	ContentData interface{}
	ContentType string
	StatusCode  int
	IsAbort     bool
}

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * view result data * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*ActionResult) Data

func (result *ActionResult) Data(data []byte, args ...interface{})

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * rendering bytes * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*ActionResult) Error

func (result *ActionResult) Error(msg string)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * rendering error strings * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*ActionResult) File

func (result *ActionResult) File(filepath string)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * rendering disk file * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*ActionResult) Html

func (result *ActionResult) Html(template string, args ...interface{})

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * rendering Html templates * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*ActionResult) Json

func (result *ActionResult) Json(args ...interface{})

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * rendering json strings * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*ActionResult) Redirect

func (result *ActionResult) Redirect(url string)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * rendering redirect url * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*ActionResult) Stream

func (result *ActionResult) Stream(step func(w io.Writer) bool)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * rendering io stream * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*ActionResult) String

func (result *ActionResult) String(args ...interface{})

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * rendering text strings * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*ActionResult) Xml

func (result *ActionResult) Xml(args ...interface{})

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * rendering xml strings * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type AliPay

type AliPay struct {
	AppId         string    `json:"app_id"`
	SellerId      string    `json:"seller_id"`
	PublicKey     string    `json:"public_key"`
	AppPublicKey  string    `json:"app_public_key"`
	AppPrivateKey string    `json:"app_private_key"`
	AppPrivatePem string    `json:"app_private_pem"`
	GatewayUrl    string    `json:"gateway_url"`
	ReturnUrl     string    `json:"return_url"`
	NotifyUrl     string    `json:"notify_url"`
	Api           AliPayApi `json:"api"`
	SignType      string    `json:"sign_type"`
	Format        string    `json:"format"`
	IsDisabled    bool      `json:"is_disabled"`
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * alipay payment
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type AliPayApi

type AliPayApi struct {
	AppPay           string `json:"app_pay"`
	PreCreate        string `json:"pre_create"`
	TradeQuery       string `json:"trade_query"`
	TradeRefund      string `json:"trade_refund"`
	TradeRefundQuery string `json:"trade_refund_query"`
	TradeClose       string `json:"trade_close"`
	BillQuery        string `json:"bill_query"`
}

================================================================================ * setting * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

type AlidayuSms

type AlidayuSms struct {
	AppKey      string      `json:"app_key"`
	AppSecret   string      `json:"app_secret"`
	Gateway     string      `json:"gateway"`
	Api         SmsApi      `json:"api"`
	Template    SmsTemplate `json:"template"`
	Format      string      `json:"format"`
	Type        string      `json:"type"`
	SignName    string      `json:"sign_name"`
	SignMethod  string      `json:"sign_method"`
	Version     string      `json:"version"`
	MobileCount int         `json:"mobile_count"`
	CodeLength  int         `json:"code_length"`
	IsSsl       bool        `json:"is_ssl"`
	IsDisabled  bool        `json:"is_disabled"`
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * alidayu sms
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*AlidayuSms) Domain

func (s *AlidayuSms) Domain() string

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 获取阿里大鱼网关域名 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type AliyunSms

type AliyunSms struct {
	AppKey      string      `json:"app_key"`
	AppSecret   string      `json:"app_secret"`
	Gateway     string      `json:"gateway"`
	Api         SmsApi      `json:"api"`
	Template    SmsTemplate `json:"template"`
	RegionId    string      `json:"region_id"`
	Format      string      `json:"format"`
	Type        string      `json:"type"`
	SignName    string      `json:"sign_name"`
	SignMethod  string      `json:"sign_method"`
	Version     string      `json:"version"`
	MobileCount int         `json:"mobile_count"`
	CodeLength  int         `json:"code_length"`
	IsSsl       bool        `json:"is_ssl"`
	IsDisabled  bool        `json:"is_disabled"`
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * aliyun sms
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*AliyunSms) Domain

func (s *AliyunSms) Domain() string

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 获取阿里云网关域名 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type Avatar

type Avatar struct {
	Male   string `json:"male"`
	Female string `json:"female"`
	Other  string `json:"other"`
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * user profile picture
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type Blackwhite

type Blackwhite struct {
	Users      []string `json:"users"` //user id
	Ips        []string `json:"ips"`   //ip
	IsDisabled bool     `json:"is_disabled"`
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * blackwhite list
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (Blackwhite) IsInIps

func (s Blackwhite) IsInIps(ip string) bool

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 判断ip是否存在 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (Blackwhite) IsInUsers

func (s Blackwhite) IsInUsers(userId string) bool

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 判断用户id是否存在 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type CacheOption

type CacheOption struct {
	Prefix     string
	Redis      RedisServer //redis server
	Expire     int         //default expiration date(seconds)
	IsRedis    bool        //false:memory | true:redis
	IsDisabled bool
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * cache option
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type Controller

type Controller struct {
	GroupName string
	Engine    IHttpEngine
	// contains filtered or unexported fields
}

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * controller data structure * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Controller) Action

func (ctrl *Controller) Action(actionHandler ActionHandler, args ...interface{}) func(*gin.Context)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * controller action * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Controller) ClearSession

func (ctrl *Controller) ClearSession(ctx *gin.Context)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * clear session * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Controller) Delete

func (ctrl *Controller) Delete(path string, actionHandler ActionHandler, args ...interface{}) gin.IRoutes

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * IHttpAction interface implementation - Http Delete * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Controller) Filter

func (ctrl *Controller) Filter(filters ...IActionFilter) IController

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * set up the controller filter * The filter interface is executed before and after the controller's method is executed * and the filter interface collection does not support sorting * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Controller) Get

func (ctrl *Controller) Get(path string, actionHandler ActionHandler, args ...interface{}) gin.IRoutes

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * IHttpAction interface implementation - Http Get * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Controller) GetApp

func (ctrl *Controller) GetApp() IApp

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * Get the IApp interface * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Controller) GetSession

func (ctrl *Controller) GetSession(ctx *gin.Context, name string) string

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * get session values * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Controller) GetToken

func (ctrl *Controller) GetToken(ctx *gin.Context) IToken

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * get IToken interface * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Controller) Head

func (ctrl *Controller) Head(path string, actionHandler ActionHandler, args ...interface{}) gin.IRoutes

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * IHttpAction interface implementation - Http Head * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Controller) Options

func (ctrl *Controller) Options(path string, actionHandler ActionHandler, args ...interface{}) gin.IRoutes

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * IHttpAction interface implementation - Http Options * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Controller) Patch

func (ctrl *Controller) Patch(path string, actionHandler ActionHandler, args ...interface{}) gin.IRoutes

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * IHttpAction interface implementation - Http Patch * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Controller) Post

func (ctrl *Controller) Post(path string, actionHandler ActionHandler, args ...interface{}) gin.IRoutes

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * IHttpAction interface implementation - Http Post * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Controller) RemoveSession

func (ctrl *Controller) RemoveSession(ctx *gin.Context, name string)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * remove session values * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Controller) SaveSession

func (ctrl *Controller) SaveSession(ctx *gin.Context, name, value string)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * save session values * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Controller) ValidateSession

func (ctrl *Controller) ValidateSession(ctx *gin.Context, name, value string, args ...interface{}) bool

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * check session value * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type Cookie struct {
	Name       string `json:"name"`
	Path       string `json:"path"`
	Domain     string `json:"domain"`
	MaxAge     int    `json:"max_age"`
	IsHttpOnly bool   `json:"is_http_only"`
	IsSecure   bool   `json:"is_secure"`
}

================================================================================ * Cookie * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

type CorsDomain

type CorsDomain struct {
	Domains    []string `json:"domains"`
	IsAllowAll bool     `json:"is_allow_all"`
	IsDisabled bool     `json:"is_disabled"`
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * security domain
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type CustomError

type CustomError struct {
	Code int32
	Msg  string
}

================================================================================ * Custom Error * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

func NewCustomError

func NewCustomError(msg string) *CustomError

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * instantiate custom error * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func NewError

func NewError(code int32, msg string) *CustomError

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * instantiate custom error * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (CustomError) Error

func (err CustomError) Error() string

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * error interface implementation * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type DatabaseConnection

type DatabaseConnection struct {
	Key           string
	Database      string
	Dialect       string
	ShardingCount int32
	Servers       []DatabaseServer
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * database connection
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type DatabaseOption

type DatabaseOption struct {
	Connections []DatabaseConnection
	IsLog       bool
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * database option
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type DatabaseServer

type DatabaseServer struct {
	Index    int32
	Username string
	Password string
	Host     string
}

================================================================================ * setting * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

type DomainIcp

type DomainIcp struct {
	IcpNo     string `form:"icp_no" json:"icp_no"`
	RecordNo  string `form:"record_no" json:"record_no"`
	RecordUrl string `form:"record_url" json:"record_url"`
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * domain icp
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type DomainOption

type DomainOption struct {
	AppHost    string
	ImageHost  string
	AudioHost  string
	VideoHost  string
	FileHost   string
	Seo        DomainSeo
	Icp        DomainIcp
	Template   DomainTemplate
	Copyright  string
	Version    string
	StatusCode string
	IsSsl      bool
	IsTest     bool
	IsDebug    bool
	IsOnline   bool
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * domain option
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type DomainSeo

type DomainSeo struct {
	Author      string `form:"author" json:"author"`
	Title       string `form:"title" json:"title"`
	Keywords    string `form:"keywords" json:"keywords"`
	Description string `form:"description" json:"description"`
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * domain seo
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type DomainTemplate

type DomainTemplate struct {
	Path       string   `json:"path"`       //html template path
	Extensions []string `json:"extensions"` //extension collection
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * html template
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type File

type File struct {
	Id   string `form:"id" json:"id"`
	Path string `form:"path" json:"path"`
	Url  string `form:"url" json:"-"`
	Data []byte `form:"data" json:"-"`
	Size int64  `form:"size" json:"-"`
}

func (*File) IdInt64

func (s *File) IdInt64() int64

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 获取int64值 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*File) SetIdInt64

func (s *File) SetIdInt64(id int64)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 设置int64值 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type Filter

type Filter struct {
	Name string
}

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * filter data struct * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type IActionFilter

type IActionFilter interface {
	Before(*gin.Context) IActionResult
	After(*gin.Context)
}

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * action filter interface * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type IActionFilterList

type IActionFilterList []IActionFilter

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * action filter interface * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type IActionResult

type IActionResult interface {
	Render()
}

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * action result interface * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type IApp

type IApp interface {
	GetName() string
	GetSetting() *Setting
	GetRouter() IHttpRouter

	RegisterTask(task ITask) error
	GetTasks() []ITask
}

================================================================================ * ging web integration framework * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

func GetApp

func GetApp(args ...string) IApp

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * get app * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func NewApp

func NewApp(name string, setting *Setting, router IHttpRouter) IApp

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * instantiating app * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type IController

type IController interface {
	IHttpAction

	Action(actionHandler ActionHandler, args ...interface{}) func(*gin.Context)
	Filter(filters ...IActionFilter) IController

	SaveSession(ctx *gin.Context, name, value string)
	GetSession(ctx *gin.Context, name string) string
	ValidateSession(ctx *gin.Context, name, value string, args ...interface{}) bool
	RemoveSession(ctx *gin.Context, name string)
	ClearSession(ctx *gin.Context)

	GetToken(ctx *gin.Context) IToken
	GetApp() IApp
}

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * controller interface * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func NewController

func NewController(groupName string, engine IHttpEngine, args ...IActionFilter) IController

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * instantiating the controller * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type IDiskFileOperation

type IDiskFileOperation interface {
	UploadFileToDisk(data []byte, fileExtName string) (*File, error)
	DeleteDiskFile(filename string) error
}

================================================================================ * 文件数据 * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

type IFdfsFileOperation

type IFdfsFileOperation interface {
	GetFileByFileId(fileId string) (*File, error)
	UploadFileToFdfs(data []byte, fileExtName string) (*File, error)
	DeleteFileByFileId(fileId string) error
}

================================================================================ * 文件数据 * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

type IFileOperation

type IFileOperation interface {
	Upload(data []byte, fileExtName string, args ...bool) (*File, error)
	Delete(filename string, args ...bool) error
}

================================================================================ * 文件数据 * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

type IFilePath

type IFilePath interface {
	UrlToPath(url string, args ...string) string
	PathToUrl(path string, args ...string) string
}

================================================================================ * 文件数据 * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

type IFileStorage

type IFileStorage interface {
	IFilePath
	IFileOperation
}

================================================================================ * 文件数据 * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

func GetFileStorage

func GetFileStorage() IFileStorage

func NewFileStorage

func NewFileStorage() IFileStorage

================================================================================ * 初始化FileStorage * author: smalltour - 老牛|共生美好 * ================================================================================

type IHttpAction

type IHttpAction interface {
	Get(path string, actionHandler ActionHandler, args ...interface{}) gin.IRoutes
	Post(path string, actionHandler ActionHandler, args ...interface{}) gin.IRoutes
	Delete(path string, actionHandler ActionHandler, args ...interface{}) gin.IRoutes
	Patch(path string, actionHandler ActionHandler, args ...interface{}) gin.IRoutes
	Options(path string, actionHandler ActionHandler, args ...interface{}) gin.IRoutes
	Head(path string, actionHandler ActionHandler, args ...interface{}) gin.IRoutes
}

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * Http请求动作接口 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type IHttpEngine

type IHttpEngine interface {
	Engine() *gin.Engine
	Middleware(args ...gin.HandlerFunc)
	Get(groupName, path string, actionHandler ActionHandler) gin.IRoutes
	Post(groupName, path string, actionHandler ActionHandler) gin.IRoutes
	NoRoute(routeHandler gin.HandlerFunc)
	Group(path string) *gin.RouterGroup
	Render(render render.HTMLRender)
	Static(routerPath, filePath string)
}

================================================================================ * http engine * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

func NewHttpEngine

func NewHttpEngine(templatePath string, model string, isDebug bool) IHttpEngine

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * instantiating http engine * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type IHttpRouter

type IHttpRouter interface {
	Route() *gin.Engine
}

================================================================================ * ging web framework * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

type ITask

type ITask interface {
	GetName() string
	Run(app IApp)
}

================================================================================ * Task * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

type IToken

type IToken interface {
	GetToken() string
	ParseToken(token, userAgent string) error

	GetPayload() *TokenPayload
	SetPayload(payload *TokenPayload)

	SetExpire(expire int64)
	SetAuthenticated(isAuthenticated bool)

	IsAuthenticated() bool
	IsExpired() bool
	IsValid() bool
}

func GetToken

func GetToken(ctx *gin.Context) IToken

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * get token * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type ImageOption

type ImageOption struct {
	Avatar  Avatar //user profile picture
	Default string //default picture
	Font    string //font path
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * image option
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type IpLimit

type IpLimit struct {
	Minute     int  `json:"minute"`      //same ip(minutes)
	Count      int  `json:"count"`       //same ip max count
	IsDisabled bool `json:"is_disabled"` //is disabled
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * same Ip limit
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type LogOption

type LogOption struct {
	Level      string //INFO | WARN | DEBUG | ERROR
	LogonCount int    //Number of logon
	IsDisabled bool
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * log option
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type LogonOption

type LogonOption struct {
	AuthorizeUrl string      //certified url
	DefaultUrl   string      //default URL after successful certification
	PassUrls     []string    //skip the certified URL collection
	Cookie       Cookie      //cookie
	Ip           IpLimit     //same ip limit
	Time         TimeLimit   //time limit
	Test         TestAccount //test account
	ErrorCount   int32       //Number of login errors
	LockMinute   int32       //Number of lock minutes after error symup
	IsCookie     bool        //After the login is successful, the response header returns the token string, otherwise the client cookie is set
	IsSliding    bool        //sliding expiration date
	IsCaptcha    bool        //human-machine verification code
	IsMobile     bool        //allow your phone to sign in
	IsUsername   bool        //allow user name login
	IsDisabled   bool        //logon is closed
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * sign-in option
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type MailOption

type MailOption struct {
	Smtp MailServer
	Pop3 MailServer
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * mail option
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type MailServer

type MailServer struct {
	Host       string `json:"host"`
	Port       int32  `json:"port"`
	Username   string `json:"username"`
	Password   string `json:"password"`
	IsSsl      bool   `json:"is_ssl"`
	IsDisabled bool   `json:"is_disabled"`
}

================================================================================ * setting * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

type OauthApp

type OauthApp struct {
	AppId            string `json:"app_id"`
	AppSecret        string `json:"app_secret"`
	CallbackUrl      string `json:"callback_url"`
	AuthorizeCodeUrl string `json:"authorize_code_url"`
	AccessTokenUrl   string `json:"access_token_url"`
	RefreshTokenUrl  string `json:"refresh_token_url"`
	OpenIdUrl        string `json:"open_id_url"`
	UserInfoUrl      string `json:"user_info_url"`
	IsDisabled       bool   `json:"is_disabled"`
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * third-party login app
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type OauthOption

type OauthOption struct {
	Wechat OauthPlatform
	Qq     OauthPlatform
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * third-party login option
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type OauthPlatform

type OauthPlatform struct {
	Ios     OauthApp
	Android OauthApp
	Pc      OauthApp
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * third-party login platform
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type Paging

type Paging struct {
	PagingIndex int64  `form:"paging_index" json:"paging_index"` //current page index
	PagingSize  int64  `form:"paging_size" json:"paging_size"`   //size per page
	TotalRecord int64  `form:"total_record" json:"total_record"` //total records
	PagingCount int64  `form:"paging_count" json:"paging_count"` //total pages
	Sortorder   string `form:"sortorder" json:"-"`               //sort
	Group       string `form:"group" json:"-"`                   //group
	IsTotalOnce bool   `form:"-" json:"-"`                       //calculate the total number of records only on the first page(every time by default)
}

================================================================================ * paging * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

func NewPaging

func NewPaging() *Paging

func (*Paging) EndIndex

func (paging *Paging) EndIndex() int64

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * get the end record index * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Paging) Offset

func (paging *Paging) Offset() int64

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * get paginated offset * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Paging) SetTotalRecord

func (paging *Paging) SetTotalRecord(totalRecord int64)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * set the total number of records * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type PagingResult

type PagingResult struct {
	Result
	Paging *Paging
}

================================================================================ * json result * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

type PayOption

type PayOption struct {
	AliPay    AliPay
	WechatPay WechatPay
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * payment option
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type QueueOption

type QueueOption struct {
	Server       QueueServerOption
	VirtualHost  string
	Exchange     string
	ExchangeType string
	IsPersistent bool
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * message queue option
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type QueueServerOption

type QueueServerOption struct {
	Ip       string
	Port     int
	Username string
	Password string
	Timeout  int
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * message queue server
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type RedisServer

type RedisServer struct {
	Ip       string
	Port     int
	Password string
	Timeout  int
	Db       int //redis db index
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * redis server
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type RegisterInvitation

type RegisterInvitation struct {
	Count      int32 `json:"count"`       //maximum number of invitations
	IsDisabled bool  `json:"is_disabled"` //is disabled
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * sign up for an invitation
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type RegisterOption

type RegisterOption struct {
	Username          RegisterRule       //username rules
	Password          RegisterRule       //password rules
	Invitation        RegisterInvitation //invitation
	Ip                IpLimit            //same ip limit
	Time              TimeLimit          //time limit
	IsConfirmPassword bool               //need confirm password
	IsCaptcha         bool               //human-machine verification code
	IsApprove         bool               //need approve
	IsUsername        bool               //allow your username to register
	IsMobile          bool               //allow your phone to register
	IsDisabled        bool
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * sign up option
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type RegisterRule

type RegisterRule struct {
	Rule       string   `json:"rule"`       //regular
	Forbiddens []string `json:"forbiddens"` //prohibited collections
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * sign up rule
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type Result

type Result struct {
	Code int32
	Msg  string
	Data interface{}
}

================================================================================ * json result * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

func (*Result) SetError

func (result *Result) SetError(err error)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * set error status information * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type SearchOption

type SearchOption struct {
	Hosts               []string // Host collection
	DefaultAnalyzer     string   // Default word breaker name
	NumberOfShards      int      // Number of shards
	NumberOfReplicas    int      // Number of copies
	HealthcheckInterval int      // Health test interval, seconds
	IsDisabled          bool
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * search option
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type SecurityOption

type SecurityOption struct {
	ApiSecret     string     //api key
	EncryptSecret string     //secure encryption Key
	CaptchaExpire int        //Man-machine check expiration time(minutes)
	Black         Blackwhite //blacklist
	White         Blackwhite //whitelist
	Ip            IpLimit
	InTime        TimeLimit //write time
	OutTime       TimeLimit //out time
	Cors          CorsDomain
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * security option
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type ServerOption

type ServerOption struct {
	Host  string
	Ports []int
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * server option
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type SessionOption

type SessionOption struct {
	Cookie     Cookie      //cookie
	Redis      RedisServer //redis server
	IsRedis    bool        //false:cookie | true:redis
	IsDisabled bool
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * session option
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type Setting

type Setting struct {
	WorkerNodeId int64
	Server       ServerOption
	Domain       DomainOption
	Image        ImageOption
	Register     RegisterOption
	Logon        LogonOption
	Session      SessionOption
	Cache        CacheOption
	Queue        QueueOption
	Database     DatabaseOption
	Security     SecurityOption
	Oauth        OauthOption
	Pay          PayOption
	Mail         MailOption
	Sms          SmsOption
	Storage      StorageOption
	Search       SearchOption
	Log          LogOption
}

================================================================================ * setting * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

type SmsApi

type SmsApi struct {
	Send      string `json:"send"`
	SendQuery string `json:"send_query"`
}

================================================================================ * setting * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

type SmsOption

type SmsOption struct {
	Aliyun  AliyunSms
	Alidayu AlidayuSms
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * sms option
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type SmsTemplate

type SmsTemplate struct {
	Logon        string `json:"logon"`
	Register     string `json:"register"`
	Auth         string `json:"auth"`
	Info         string `json:"info"`
	FindPassword string `json:"find_password"`
}

================================================================================ * setting * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

type StaticRoute

type StaticRoute struct {
	File string `json:"file"` //static file path identity
	Fdfs string `json:"fdfs"` //fdfs file path identity
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * static route
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type StorageOption

type StorageOption struct {
	Static     StaticRoute
	Upload     UploadFile
	Server     StorageServer
	IsFdfs     bool
	IsDisabled bool
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * storage option
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type StorageServer

type StorageServer struct {
	Trackers []string `json:"trackers"` //Tracker Host collection
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * fdfs server
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type TestAccount

type TestAccount struct {
	Mobiles    []string `json:"mobiles"`
	MobileCode string   `json:"mobile_code"`
	IsDisabled bool     `json:"is_disabled"`
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * test account
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type TimeLimit

type TimeLimit struct {
	Opening    int  `json:"opening"` //start(minutes)
	Closing    int  `json:"closing"` //end(minutes)
	IsDisabled bool `json:"is_disabled"`
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * time limit
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (TimeLimit) IsTime

func (s TimeLimit) IsTime() bool

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 判断当前时刻是否属于限制时段中 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type Token

type Token struct {
	// contains filtered or unexported fields
}

func NewToken

func NewToken(secret string) *Token

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * instantiating token * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Token) GetPayload

func (s *Token) GetPayload() *TokenPayload

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * get payload * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Token) GetToken

func (s *Token) GetToken() string

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * get token string * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Token) IsAuthenticated

func (s *Token) IsAuthenticated() bool

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * is certified * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Token) IsExpired

func (s *Token) IsExpired() bool

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * has token expired * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Token) IsValid

func (s *Token) IsValid() bool

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * token signature is valid * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Token) ParseToken

func (s *Token) ParseToken(token, userAgent string) error

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * parse token * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Token) SetAuthenticated

func (s *Token) SetAuthenticated(isAuthenticated bool)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * set is certified * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Token) SetExpire

func (s *Token) SetExpire(expire int64)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * set expire * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*Token) SetPayload

func (s *Token) SetPayload(payload *TokenPayload)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * set payload * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type TokenPayload

type TokenPayload struct {
	Owner           string                 `json:"iss"`              //签发者
	Domain          string                 `json:"aud"`              //接收域
	UserId          string                 `json:"sub"`              //用户id
	Username        string                 `json:"username"`         //用户名
	Nickname        string                 `json:"nickname"`         //用户昵称
	Avatar          string                 `json:"avatar"`           //用户图像
	Roles           []string               `json:"roles"`            //角色名集合
	UserAgent       string                 `json:"ua"`               //客户端代理数据
	Extend          map[string]interface{} `json:"extend"`           //扩展数据
	IsAuthenticated bool                   `json:"is_authenticated"` //是否已验证
	Start           int64                  `json:"iat"`              //签发时间(距离1970-1-1的秒数)
	Expire          int64                  `json:"exp"`              //过期时间(距离1970-1-1的秒数)
}

func (*TokenPayload) Deserialize

func (s *TokenPayload) Deserialize(payload string) error

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * TokenPayload json deserialization * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*TokenPayload) Serialize

func (s *TokenPayload) Serialize() (string, error)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * TokenPayload json serialization * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func (*TokenPayload) UserIdInt64

func (s *TokenPayload) UserIdInt64() int64

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * UserId string to UserId int64 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type UploadFile

type UploadFile struct {
	Root  string         `json:"root"` //file upload root
	Temp  string         `json:"temp"` //file upload temporary directory
	Image UploadFileItem `json:"image"`
	Audio UploadFileItem `json:"audio"`
	Video UploadFileItem `json:"video"`
	File  UploadFileItem `json:"file"`
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * upload file
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type UploadFileItem

type UploadFileItem struct {
	Formats []string `json:"formats"` //format collection
	Size    int32    `json:"size"`    //size bytes
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * upload file option
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type WechatPay

type WechatPay struct {
	AppId      string       `json:"app_id"`
	PartnerId  string       `json:"partner_id"`
	AppSecret  string       `json:"app_secret"`
	ApiSecret  string       `json:"api_secret"`
	NotifyUrl  string       `json:"notify_url"`
	Api        WechatPayApi `json:"api"`
	FeeType    string       `json:"fee_type"`
	SignType   string       `json:"sign_type"`
	IsDisabled bool         `json:"is_disabled"`
}
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 * wechat payment
	 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type WechatPayApi

type WechatPayApi struct {
	UnifiedOrder string `json:"unified_order"`
	OrderQuery   string `json:"order_query"`
	Refund       string `json:"refund"`
	RefundQuery  string `json:"refund_query"`
	CloseOrder   string `json:"close_order"`
	DownloadBill string `json:"download_bill"`
	Report       string `json:"report"`
}

================================================================================ * setting * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================

Directories

Path Synopsis
middleware
plugin

Jump to

Keyboard shortcuts

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