Documentation
¶
Index ¶
- Constants
- func GetFuncArgs(t reflect.Type) []reflect.Type
- type App
- type Cfg
- type Ctx
- func (p Ctx) CurPart() *urlPart
- func (p *Ctx) Error(code int) *Ctx
- func (p *Ctx) ErrorJson(code int, m T) *Ctx
- func (p *Ctx) Forbidden()
- func (p *Ctx) Get(k string) string
- func (p *Ctx) GetId() GUID
- func (p *Ctx) HandleStatusJson(s IStatus)
- func (p Ctx) IsAuth() bool
- func (p *Ctx) IsDEL() bool
- func (p *Ctx) IsErr() bool
- func (p *Ctx) IsGET() bool
- func (p *Ctx) IsPOST() bool
- func (p *Ctx) IsPUT() bool
- func (p *Ctx) Json(m T) *Ctx
- func (p Ctx) NextPart() *urlPart
- func (p *Ctx) NotFound()
- func (p *Ctx) OK()
- func (p *Ctx) Redirect(url string)
- func (p *Ctx) ReqIp() string
- func (p *Ctx) ServeFile() bool
- func (p *Ctx) Set(k string, v T)
- func (p *Ctx) SetCookie(c http.Cookie)
- func (p *Ctx) SetHandled()
- func (p *Ctx) SetUid(uid GUID)
- func (p *Ctx) Text(str string)
- func (p *Ctx) Tmpl(tpl string, o T)
- func (p *Ctx) Tmpl2(tpl string, o T)
- func (p *Ctx) Uid() GUID
- type HandleNode
- type Handler
- type INode
- type ISessions
- type Interceptor
- type Log
- type Node
- func (p *Node) Actions() map[string]NodeAction
- func (p *Node) AddNode(n INode) INode
- func (p *Node) CanRoute(test string, c *Ctx) bool
- func (p *Node) CheckHttpMethod(n INode)
- func (p *Node) GetNodes() []INode
- func (p *Node) Handle(c *Ctx)
- func (p *Node) Interceptor(m *Interceptor) *Node
- func (p *Node) NeedAuth() bool
- func (p *Node) NewHandleNode(path string, handle func(*Ctx), auth bool) INode
- func (p *Node) NewParamNode(path string, auth bool) INode
- func (p *Node) NewRegexNode(path, regex string, auth bool) INode
- func (p *Node) NewSubNode(path string, auth bool) INode
- func (p *Node) RunInterceptors(c *Ctx) INode
- type NodeAction
- type ParamNode
- type RegexNode
- type Req
- func (p Req) CurPart() *urlPart
- func (p *Req) HasToken() bool
- func (p *Req) IsAcceptJson() bool
- func (p *Req) IsJList() bool
- func (p *Req) IsJPage() bool
- func (p *Req) IsJsonContent() bool
- func (p *Req) JMethod() string
- func (p *Req) JPage() *filter.PageFilter
- func (p *Req) JsonBody(m T) bool
- func (p Req) NextPart() *urlPart
- func (p *Req) Url() string
- type Resp
- type Router
- type Tmpl
Constants ¶
View Source
const ( GET = "GET" POST = "POST" PUT = "PUT" DEL = "DELETE" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct {
Root INode
di.Container
Name string
*Cfg
ServHttp *http.Server
ServHttps *http.Server
*Router
*Tmpl
Sessions ISessions
*Log
ValidAuth func(*Ctx) (httpStatus int, stauts IStatus, uid GUID)
NotFoundHandle func(*Ctx)
}
func NewAppWithCfg ¶
type Ctx ¶
type Ctx struct {
*App
di.Container
*Req
*Resp
Scope M
Handled bool
// contains filtered or unexported fields
}
func (*Ctx) HandleStatusJson ¶
func (p *Ctx) HandleStatusJson(s IStatus)
func (*Ctx) SetHandled ¶
func (p *Ctx) SetHandled()
type HandleNode ¶
type HandleNode struct {
*Node
// contains filtered or unexported fields
}
func NewHandleNode ¶
func NewHandleNode(path string, handle func(*Ctx), auth bool) *HandleNode
func (*HandleNode) Handle ¶
func (p *HandleNode) Handle(c *Ctx)
type INode ¶
type INode interface {
AddNode(n INode) INode
NewParamNode(path string, auth bool) INode
NewRegexNode(path, regex string, auth bool) INode
NewSubNode(path string, auth bool) INode
NewHandleNode(path string, handle func(*Ctx), auth bool) INode
CanRoute(test string, c *Ctx) bool
Handle(c *Ctx)
CheckHttpMethod(n INode)
RunInterceptors(c *Ctx) INode
GetNodes() []INode
NeedAuth() bool
Actions() map[string]NodeAction
}
type Interceptor ¶
type Node ¶
type Node struct {
Path string
Interceptors []*Interceptor
Nodes []INode
// contains filtered or unexported fields
}
func (*Node) Actions ¶
func (p *Node) Actions() map[string]NodeAction
func (*Node) CheckHttpMethod ¶
func (*Node) Interceptor ¶
func (p *Node) Interceptor(m *Interceptor) *Node
func (*Node) NewHandleNode ¶
func (*Node) RunInterceptors ¶
type NodeAction ¶
type RegexNode ¶
type RegexNode struct {
*Node
// contains filtered or unexported fields
}
func NewRegexNode ¶
type Req ¶
func (*Req) IsAcceptJson ¶
func (*Req) IsJsonContent ¶
func (*Req) JPage ¶
func (p *Req) JPage() *filter.PageFilter
type Resp ¶
type Resp struct {
http.ResponseWriter
}
Click to show internal directories.
Click to hide internal directories.