Documentation ¶
Index ¶
- Variables
- func AddHttpHandle(f intercept.HttpIntercept)
- func DoHttp(rw http.ResponseWriter, req *http.Request)
- func NewApiIntercept(match def.Match, caller def.Caller, serialize def.Serialize, ...) intercept.HttpIntercept
- func RegisterErrorHandler(p reflect.Type, handler ErrorHandler)
- func RegisterReturnHandler(ret def.RetAdapter)
- func WriteError(err any, rw http.ResponseWriter)
- func WriteResponse(rw http.ResponseWriter, req *http.Request, content *def.Content)
- func WriteRetResponse(rw http.ResponseWriter, req *http.Request, adapter def.RetAdapter)
- type ApiInter
- type ApiRespose
- type ErrorHandler
- type Handles
- type NotFind
- type Static
- type StaticOps
- type StaticOption
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultStatic = NewStatic()
)
Functions ¶
func AddHttpHandle ¶
func AddHttpHandle(f intercept.HttpIntercept)
func NewApiIntercept ¶
func NewApiIntercept(match def.Match, caller def.Caller, serialize def.Serialize, pool *def.MethodsPools) intercept.HttpIntercept
func RegisterErrorHandler ¶
func RegisterErrorHandler(p reflect.Type, handler ErrorHandler)
func RegisterReturnHandler ¶
func RegisterReturnHandler(ret def.RetAdapter)
func WriteError ¶
func WriteError(err any, rw http.ResponseWriter)
func WriteResponse ¶
func WriteRetResponse ¶
func WriteRetResponse(rw http.ResponseWriter, req *http.Request, adapter def.RetAdapter)
Types ¶
type ApiInter ¶
type ApiInter struct {
// contains filtered or unexported fields
}
func (*ApiInter) Http ¶
func (api *ApiInter) Http(rw http.ResponseWriter, req *http.Request, ctx *intercept.HttpContext) bool
func (*ApiInter) Order ¶
func (api *ApiInter) Order() def.HandlerOrder
type ApiRespose ¶ added in v0.1.0
type ApiRespose struct { }
func NewApiRespose ¶ added in v0.1.0
func NewApiRespose() *ApiRespose
func (*ApiRespose) Http ¶ added in v0.1.0
func (resp *ApiRespose) Http(rw http.ResponseWriter, req *http.Request, ctx *intercept.HttpContext) bool
Http implements intercept.HttpIntercept.
func (*ApiRespose) Order ¶ added in v0.1.0
func (*ApiRespose) Order() def.HandlerOrder
Order implements intercept.HttpIntercept.
type ErrorHandler ¶
type ErrorHandler func(err interface{}) interface{}
type Handles ¶
type Handles []intercept.HttpIntercept
type NotFind ¶ added in v0.1.0
type NotFind struct {
// contains filtered or unexported fields
}
func NewNotFind ¶ added in v0.1.0
func (*NotFind) Http ¶ added in v0.1.0
func (n *NotFind) Http(rw http.ResponseWriter, req *http.Request, ctx *intercept.HttpContext) bool
Http implements intercept.HttpIntercept.
func (*NotFind) Order ¶ added in v0.1.0
func (*NotFind) Order() def.HandlerOrder
Order implements intercept.HttpIntercept.
type Static ¶ added in v0.1.0
type Static struct {
// contains filtered or unexported fields
}
func (*Static) HandleStatic ¶ added in v0.1.0
func (s *Static) HandleStatic(path, dirPath string, fileSystem http.FileSystem, sOps ...StaticOption)
HandleStatic path is the mapping url dirPath is the real path fileSystem open[ join(path + dirPath) ]
func (*Static) Http ¶ added in v0.1.0
func (s *Static) Http(rw http.ResponseWriter, req *http.Request, ctx *intercept.HttpContext) bool
func (*Static) Order ¶ added in v0.1.0
func (s *Static) Order() def.HandlerOrder
type StaticOption ¶ added in v0.1.0
type StaticOption func(StaticOps)
func StaticDefaultFile ¶ added in v0.1.0
func StaticDefaultFile(file string) StaticOption
func StaticRewrite ¶ added in v0.1.0
func StaticRewrite(orig string, replace string) StaticOption
Source Files ¶
Click to show internal directories.
Click to hide internal directories.