Documentation
¶
Index ¶
- Variables
- func AutoRestart()
- func BodyManager(param *Param)
- func CloneValue(src reflect.Value) reflect.Value
- func ContextManager(param *Param)
- func CrossDomainMW() gin.HandlerFunc
- func DefaultManager(param *Param)
- func Error(code int, msg string) error
- func FileManager(param *Param)
- func SelfManager(param *Param)
- func SetErrorHander(eh IErrorHander)
- type BaseService
- type Class
- type Engine
- func (this *Engine) Any(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (this *Engine) Body(body interface{}) IRouter
- func (this *Engine) DELETE(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (this *Engine) Data(data interface{}) IRouter
- func (this *Engine) FileParam(name, desc string) *core.Param
- func (this *Engine) GET(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (this *Engine) Group(relativePath string, handlers ...gin.HandlerFunc) *RouterGroup
- func (this *Engine) HEAD(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (this *Engine) Handle(httpMethod string, relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (this *Engine) Info(info ...string) IRouter
- func (this *Engine) OPTIONS(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (this *Engine) PATCH(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (this *Engine) POST(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (this *Engine) PUT(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (this *Engine) PathParam(name, desc string) *core.Param
- func (this *Engine) QueryParam(name, desc string) *core.Param
- func (this *Engine) Run(addr ...string) (err error)
- func (this *Engine) Swagger(relativePath string)
- type ErrorHander
- type IClass
- type IErrorHander
- type IRouter
- type IService
- type ITagName
- type Method
- type Param
- type RouteMaker
- type RouterGroup
- func (this *RouterGroup) Any(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (this *RouterGroup) Body(body interface{}) IRouter
- func (this *RouterGroup) DELETE(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (this *RouterGroup) Data(data interface{}) IRouter
- func (this *RouterGroup) FileParam(name, desc string) *core.Param
- func (this *RouterGroup) GET(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (this *RouterGroup) Group(relativePath string, handlers ...gin.HandlerFunc) *RouterGroup
- func (this *RouterGroup) HEAD(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (this *RouterGroup) Handle(httpMethod string, relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (this *RouterGroup) Info(info ...string) IRouter
- func (this *RouterGroup) OPTIONS(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (this *RouterGroup) PATCH(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (this *RouterGroup) POST(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (this *RouterGroup) PUT(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (this *RouterGroup) PathParam(name, desc string) *core.Param
- func (this *RouterGroup) QueryParam(name, desc string) *core.Param
Constants ¶
This section is empty.
Variables ¶
View Source
var Log = log.New(os.Stdout, "[ gev ] ", log.Ltime|log.Lshortfile)
Functions ¶
func AutoRestart ¶
func AutoRestart()
func BodyManager ¶
func BodyManager(param *Param)
func ContextManager ¶
func ContextManager(param *Param)
func CrossDomainMW ¶
func CrossDomainMW() gin.HandlerFunc
func FileManager ¶
func FileManager(param *Param)
func SetErrorHander ¶
func SetErrorHander(eh IErrorHander)
Types ¶
type BaseService ¶
type BaseService struct {
// contains filtered or unexported fields
}
func (*BaseService) After ¶
func (this *BaseService) After(data interface{}, err error)
func (*BaseService) Finish ¶
func (this *BaseService) Finish(err interface{})
type Engine ¶
func (*Engine) Group ¶
func (this *Engine) Group(relativePath string, handlers ...gin.HandlerFunc) *RouterGroup
type ErrorHander ¶
type ErrorHander int
func (*ErrorHander) Ok ¶
func (this *ErrorHander) Ok(c *gin.Context, data interface{})
type IErrorHander ¶
type IErrorHander interface {
Ok(c *gin.Context, data interface{})
Err(c *gin.Context, code int, err error)
Api(c *gin.Context, data interface{}, err error)
}
处理错误接口
type IRouter ¶
type IRouter interface {
DELETE(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
GET(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
HEAD(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
OPTIONS(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
PATCH(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
POST(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
PUT(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
Handle(httpMethod string, relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
Group(string, ...gin.HandlerFunc) *RouterGroup
Body(body interface{}) IRouter
Data(data interface{}) IRouter
Info(info ...string) IRouter
QueryParam(name, desc string) *core.Param
PathParam(name, desc string) *core.Param
FileParam(name, desc string) *core.Param
}
type Method ¶
type Method struct {
Doc map[string][]string // remment info
Name string
StructName string // "" if not a struct function
Func reflect.Value
Params []*Param
OutType reflect.Type
Tag string
}
func (*Method) HttpMethod ¶
httpmethod from remment like below @method DELETE or return POST if contains body Param
func (*Method) OnlyOneParam ¶
type RouteMaker ¶
type RouteMaker struct {
Methods []*Method
// contains filtered or unexported fields
}
func NewRouteMaker ¶
func NewRouteMaker() *RouteMaker
func (*RouteMaker) AddMethod ¶
func (this *RouteMaker) AddMethod(f interface{}, tags ...string) *Method
read route information from one function
func (*RouteMaker) AddParamManager ¶
func (this *RouteMaker) AddParamManager(fn paramManager)
add paramManager function LIFO the last add paramManager match condition will take effect
func (*RouteMaker) AddRoute ¶
func (this *RouteMaker) AddRoute(f interface{}, tags ...string)
read route information,save to this.Methods
type RouterGroup ¶
type RouterGroup struct {
*gin.RouterGroup
// contains filtered or unexported fields
}
func (*RouterGroup) Any ¶
func (this *RouterGroup) Any(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
func (*RouterGroup) Body ¶
func (this *RouterGroup) Body(body interface{}) IRouter
func (*RouterGroup) DELETE ¶
func (this *RouterGroup) DELETE(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
func (*RouterGroup) Data ¶
func (this *RouterGroup) Data(data interface{}) IRouter
func (*RouterGroup) GET ¶
func (this *RouterGroup) GET(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
func (*RouterGroup) Group ¶
func (this *RouterGroup) Group(relativePath string, handlers ...gin.HandlerFunc) *RouterGroup
func (*RouterGroup) HEAD ¶
func (this *RouterGroup) HEAD(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
func (*RouterGroup) Handle ¶
func (this *RouterGroup) Handle(httpMethod string, relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
func (*RouterGroup) Info ¶
func (this *RouterGroup) Info(info ...string) IRouter
func (*RouterGroup) OPTIONS ¶
func (this *RouterGroup) OPTIONS(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
func (*RouterGroup) PATCH ¶
func (this *RouterGroup) PATCH(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
func (*RouterGroup) POST ¶
func (this *RouterGroup) POST(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
func (*RouterGroup) PUT ¶
func (this *RouterGroup) PUT(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
func (*RouterGroup) QueryParam ¶
func (this *RouterGroup) QueryParam(name, desc string) *core.Param
Click to show internal directories.
Click to hide internal directories.
