Documentation ¶
Index ¶
- func SplitAndSelect(s, seq string, index int) string
- func Start(config config.ApiConfig)
- type Context
- type HandlerFunc
- type RestHandler
- func (rest *RestHandler) Add(method, url string, handlerFunc http.Handler)
- func (rest *RestHandler) Delete(url string, handler http.Handler)
- func (rest *RestHandler) Get(url string, handler http.Handler)
- func (rest *RestHandler) Post(url string, handler http.Handler)
- func (rest *RestHandler) Put(url string, handler http.Handler)
- func (rest *RestHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SplitAndSelect ¶
SplitAndSelect 分割并选择其中一段 @param index 分割后数组的下标,支持负数,负数为倒序获取,超过数组的部分下标
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) URISubSelect ¶
func (*Context) WriteError ¶
func (*Context) WriteString ¶
type HandlerFunc ¶
type HandlerFunc func(Context)
type RestHandler ¶
type RestHandler struct {
// contains filtered or unexported fields
}
func (*RestHandler) Add ¶
func (rest *RestHandler) Add(method, url string, handlerFunc http.Handler)
Add 注册GET方法处理器 如果url以`r:`开头,说明是一个正则表达式路径
func (*RestHandler) Delete ¶
func (rest *RestHandler) Delete(url string, handler http.Handler)
Delete 注册DELETE方法处理器
func (*RestHandler) Get ¶
func (rest *RestHandler) Get(url string, handler http.Handler)
Get 注册GET方法处理器
func (*RestHandler) Post ¶
func (rest *RestHandler) Post(url string, handler http.Handler)
Post 注册POST方法处理器
func (*RestHandler) Put ¶
func (rest *RestHandler) Put(url string, handler http.Handler)
Put 注册PUT方法处理器
func (*RestHandler) ServeHTTP ¶
func (rest *RestHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP 实现Handle接口
Click to show internal directories.
Click to hide internal directories.