Documentation ¶
Index ¶
- Constants
- Variables
- func Convert(handler interface{}) gin.HandlerFunc
- func DBMap(columns []string, rows *sql.Rows) ([]interface{}, error)
- func Error(err error, msg ...string)
- func ErrorHandler() gin.HandlerFunc
- func ExecExpr(expr Expr, data map[string]interface{}) (string, error)
- func GenTplFunc(path string)
- func GetConfigValue(m UserConfig, prefix []string, index int) interface{}
- func HandleFairing(responder Responder, ctx *gin.Context) interface{}
- func IsAnnotation(t reflect.Type) bool
- func IsComparableExpr(expr string) bool
- func IsNumeric(val interface{}) bool
- func LoadConfigFile() []byte
- func Task(f TaskFunc, cb func(), params ...interface{})
- func Throw(err string, code int, context *gin.Context)
- type Annotation
- type Bean
- type ComparableExpr
- type Expr
- type Fairing
- type FairingHandler
- type GPA
- type GPAUtil
- type Goft
- func (this *Goft) Attach(f ...Fairing) *Goft
- func (this *Goft) Beans(beans ...Bean) *Goft
- func (this *Goft) Config(cfgs ...interface{}) *Goft
- func (this *Goft) Handle(httpMethod, relativePath string, handler interface{}) *Goft
- func (this *Goft) HandleWithFairing(httpMethod, relativePath string, handler interface{}, fairings ...Fairing) *Goft
- func (this *Goft) Launch()
- func (this *Goft) LaunchWithPort(port int)
- func (this *Goft) Mount(group string, classes ...IClass) *Goft
- func (this *Goft) Task(cron string, expr interface{}) *Goft
- type GoftTree
- type GormAdapter
- type IClass
- type Json
- type JsonResponder
- type Model
- type Models
- type Param
- type Params
- type Query
- type Responder
- type RouteInfo
- type RoutesInfo
- type ServerConfig
- type SimpleExpr
- type SimpleQuery
- func (this SimpleQuery) Args() []interface{}
- func (this SimpleQuery) First() bool
- func (this SimpleQuery) Get() interface{}
- func (this SimpleQuery) Key() string
- func (this SimpleQuery) Mapping() map[string]string
- func (this SimpleQuery) Sql() string
- func (this SimpleQuery) WithArgs(args ...interface{}) *SimpleQueryWithArgs
- func (this SimpleQuery) WithFirst() *SimpleQueryWithArgs
- func (this SimpleQuery) WithKey(key string) *SimpleQueryWithArgs
- func (this SimpleQuery) WithMapping(mapping map[string]string) *SimpleQueryWithArgs
- type SimpleQueryWithArgs
- func NewSimpleQueryWithArgs(sql string, args []interface{}) *SimpleQueryWithArgs
- func NewSimpleQueryWithFetchFirst(sql string) *SimpleQueryWithArgs
- func NewSimpleQueryWithKey(sql string, key string) *SimpleQueryWithArgs
- func NewSimpleQueryWithMapping(sql string, mapping map[string]string) *SimpleQueryWithArgs
- func (this *SimpleQueryWithArgs) Args() []interface{}
- func (this *SimpleQueryWithArgs) First() bool
- func (this *SimpleQueryWithArgs) Get() interface{}
- func (this *SimpleQueryWithArgs) Key() string
- func (this *SimpleQueryWithArgs) Mapping() map[string]string
- func (this *SimpleQueryWithArgs) Sql() string
- func (this *SimpleQueryWithArgs) WithFirst() *SimpleQueryWithArgs
- func (this *SimpleQueryWithArgs) WithKey(key string) *SimpleQueryWithArgs
- func (this *SimpleQueryWithArgs) WithMapping(mapping map[string]string) *SimpleQueryWithArgs
- type SqlQueryResponder
- type SqlResponder
- type StringResponder
- type SysConfig
- type TaskExecutor
- type TaskFunc
- type TreeNode
- type TreeRouter
- type UserConfig
- type Value
- type Viewdeprecated
- type ViewResponder
- type Void
- type VoidResponder
Constants ¶
View Source
const ( VarPattern = `[0-9a-zA-Z_\.\(\)]+` CompareSign = ">|>=|<=|<|==|!=" CompareSignToken = "gt|ge|le|lt|eq|ne" ComparePattern = `^(` + VarPattern + `)\s*(` + CompareSign + `)\s*(` + VarPattern + `)\s*$` )
View Source
const (
HTTP_STATUS = "GOFT_STATUS"
)
Variables ¶
View Source
var AnnotationList []Annotation
View Source
var Empty = &struct{}{}
Functions ¶
func Convert ¶
func Convert(handler interface{}) gin.HandlerFunc
func ErrorHandler ¶
func ErrorHandler() gin.HandlerFunc
func GetConfigValue ¶
func GetConfigValue(m UserConfig, prefix []string, index int) interface{}
递归读取用户配置文件
func HandleFairing ¶ added in v0.2.2
Deprecated ,please call FairingHandler.handlerFairing
Types ¶
type FairingHandler ¶ added in v0.2.2
type FairingHandler struct {
// contains filtered or unexported fields
}
func NewFairingHandler ¶ added in v0.3.0
func NewFairingHandler() *FairingHandler
func (*FairingHandler) AddFairing ¶ added in v0.2.2
func (this *FairingHandler) AddFairing(f ...Fairing)
type GPAUtil ¶ added in v0.3.3
type GPAUtil struct {
GDB GPA `inject:"-"`
}
func NewGPAUtil ¶ added in v0.3.3
func NewGPAUtil() *GPAUtil
type Goft ¶
func Ignite ¶
func Ignite(ginMiddlewares ...gin.HandlerFunc) *Goft
func (*Goft) HandleWithFairing ¶ added in v0.3.0
func (*Goft) LaunchWithPort ¶ added in v0.5.3
type GoftTree ¶ added in v0.3.0
type GoftTree struct {
// contains filtered or unexported fields
}
func NewGoftTree ¶ added in v0.3.0
func NewGoftTree() *GoftTree
type GormAdapter ¶
func NewGormAdapter ¶
func NewGormAdapter() *GormAdapter
func (*GormAdapter) Name ¶
func (this *GormAdapter) Name() string
type JsonResponder ¶ added in v0.2.2
func (JsonResponder) RespondTo ¶ added in v0.2.2
func (this JsonResponder) RespondTo() gin.HandlerFunc
type Params ¶ added in v0.3.0
type Params []Param
Params is a Param-slice, as returned by the router. The slice is ordered, the first URL parameter is also the first slice value. It is therefore safe to read values by the index.
type Responder ¶
type Responder interface {
RespondTo() gin.HandlerFunc
}
type RoutesInfo ¶ added in v0.3.0
type RoutesInfo []RouteInfo
type ServerConfig ¶
type SimpleQuery ¶ added in v0.3.3
type SimpleQuery string
func (SimpleQuery) Args ¶ added in v0.3.4
func (this SimpleQuery) Args() []interface{}
func (SimpleQuery) First ¶ added in v0.3.4
func (this SimpleQuery) First() bool
func (SimpleQuery) Get ¶ added in v0.3.6
func (this SimpleQuery) Get() interface{}
func (SimpleQuery) Key ¶ added in v0.3.6
func (this SimpleQuery) Key() string
func (SimpleQuery) Mapping ¶ added in v0.3.4
func (this SimpleQuery) Mapping() map[string]string
func (SimpleQuery) Sql ¶ added in v0.3.4
func (this SimpleQuery) Sql() string
func (SimpleQuery) WithArgs ¶ added in v0.3.4
func (this SimpleQuery) WithArgs(args ...interface{}) *SimpleQueryWithArgs
func (SimpleQuery) WithFirst ¶ added in v0.3.4
func (this SimpleQuery) WithFirst() *SimpleQueryWithArgs
func (SimpleQuery) WithKey ¶ added in v0.3.6
func (this SimpleQuery) WithKey(key string) *SimpleQueryWithArgs
func (SimpleQuery) WithMapping ¶ added in v0.3.4
func (this SimpleQuery) WithMapping(mapping map[string]string) *SimpleQueryWithArgs
type SimpleQueryWithArgs ¶ added in v0.3.4
type SimpleQueryWithArgs struct {
// contains filtered or unexported fields
}
func NewSimpleQueryWithArgs ¶ added in v0.3.4
func NewSimpleQueryWithArgs(sql string, args []interface{}) *SimpleQueryWithArgs
func NewSimpleQueryWithFetchFirst ¶ added in v0.3.4
func NewSimpleQueryWithFetchFirst(sql string) *SimpleQueryWithArgs
func NewSimpleQueryWithKey ¶ added in v0.3.6
func NewSimpleQueryWithKey(sql string, key string) *SimpleQueryWithArgs
func NewSimpleQueryWithMapping ¶ added in v0.3.4
func NewSimpleQueryWithMapping(sql string, mapping map[string]string) *SimpleQueryWithArgs
func (*SimpleQueryWithArgs) Args ¶ added in v0.3.4
func (this *SimpleQueryWithArgs) Args() []interface{}
func (*SimpleQueryWithArgs) First ¶ added in v0.3.4
func (this *SimpleQueryWithArgs) First() bool
func (*SimpleQueryWithArgs) Get ¶ added in v0.3.6
func (this *SimpleQueryWithArgs) Get() interface{}
func (*SimpleQueryWithArgs) Key ¶ added in v0.3.6
func (this *SimpleQueryWithArgs) Key() string
func (*SimpleQueryWithArgs) Mapping ¶ added in v0.3.4
func (this *SimpleQueryWithArgs) Mapping() map[string]string
func (*SimpleQueryWithArgs) Sql ¶ added in v0.3.4
func (this *SimpleQueryWithArgs) Sql() string
func (*SimpleQueryWithArgs) WithFirst ¶ added in v0.3.4
func (this *SimpleQueryWithArgs) WithFirst() *SimpleQueryWithArgs
func (*SimpleQueryWithArgs) WithKey ¶ added in v0.3.6
func (this *SimpleQueryWithArgs) WithKey(key string) *SimpleQueryWithArgs
func (*SimpleQueryWithArgs) WithMapping ¶ added in v0.3.4
func (this *SimpleQueryWithArgs) WithMapping(mapping map[string]string) *SimpleQueryWithArgs
type SqlQueryResponder ¶ added in v0.3.4
func (SqlQueryResponder) RespondTo ¶ added in v0.3.4
func (this SqlQueryResponder) RespondTo() gin.HandlerFunc
type SqlResponder ¶ added in v0.3.3
type SqlResponder func(*gin.Context) SimpleQuery
func (SqlResponder) RespondTo ¶ added in v0.3.3
func (this SqlResponder) RespondTo() gin.HandlerFunc
type StringResponder ¶
func (StringResponder) RespondTo ¶
func (this StringResponder) RespondTo() gin.HandlerFunc
type SysConfig ¶
type SysConfig struct { Server *ServerConfig Config UserConfig }
系统配置
func InitConfig ¶
func InitConfig() *SysConfig
func NewSysConfig ¶
func NewSysConfig() *SysConfig
type TaskExecutor ¶
type TaskExecutor struct {
// contains filtered or unexported fields
}
func NewTaskExecutor ¶
func NewTaskExecutor(f TaskFunc, p []interface{}, callback func()) *TaskExecutor
func (*TaskExecutor) Exec ¶
func (this *TaskExecutor) Exec()
type TreeRouter ¶ added in v0.3.0
type TreeRouter struct {
// contains filtered or unexported fields
}
func NewTreeRouter ¶ added in v0.3.0
func NewTreeRouter() *TreeRouter
type UserConfig ¶
type UserConfig map[interface{}]interface{}
type ViewResponder ¶
func (ViewResponder) RespondTo ¶
func (this ViewResponder) RespondTo() gin.HandlerFunc
type VoidResponder ¶ added in v0.5.0
func (VoidResponder) RespondTo ¶ added in v0.5.0
func (this VoidResponder) RespondTo() gin.HandlerFunc
Click to show internal directories.
Click to hide internal directories.