Documentation ¶
Overview ¶
Package zephyr Create at 2021-01-19 14:41
Package zephyr Create at 2021-01-19 18:22
Package zephyr Create at 2021-01-19 14:04
Package zephyr Create at 2021-01-19 13:48
Package zephyr Create at 2021-01-19 13:48
Index ¶
- Constants
- type Action
- type Filter
- type Fit
- type Profile
- type Request
- type Resp
- type TrialItem
- type Zephyr
- func (z *Zephyr) AddFilter(filter Filter) *Zephyr
- func (z *Zephyr) AddHandler(r Action)
- func (z *Zephyr) GetLogger() *logrus.Logger
- func (z *Zephyr) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (z *Zephyr) SetAfterCompletion(afterCompletion afterCompletionFunc)
- func (z *Zephyr) SetCros(cros bool)
- func (z *Zephyr) SetErrResp(resp Resp)
- func (z *Zephyr) SetPreHandler(preHandler preHandlerFunc)
- func (z *Zephyr) SetProfile(profile *Profile)
- func (z *Zephyr) SetWrapper(wrapper wrapperFuc)
Constants ¶
View Source
const ( // GET http GET method. GET = "GET" // POST http POST method. POST = "POST" // PUT http PUT method. PUT = "PUT" // DELETE http DELETE method. DELETE = "DELETE" // HEAD http HEAD method. HEAD = "HEAD" // OPTIONS http OPTIONS method. OPTIONS = "OPTIONS" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { URL string // 请求的URL,支持正则表达式 Method []string // 支持的请求方法 Filter []Filter // 过滤器 Handler func(w http.ResponseWriter, r *http.Request) // 处理请求的方法 PreHandler preHandlerFunc AfterCompletion afterCompletionFunc Wrapper wrapperFuc }
Action request mapping
type Filter ¶
type Filter struct { Trials TrialItem Fit Fit Err func(w *http.ResponseWriter) }
Filter 过滤器.
type Profile ¶
type Profile struct { Name string // Application name Version string // Application version BuildTime string // Compilation date GoVersion string // Golang version Mode string // Deployment mode URL string // URL Desc string // Description. }
Profile 项目信息
func NewProfile ¶
NewProfile profile
type Zephyr ¶
type Zephyr struct {
// contains filtered or unexported fields
}
Zephyr web framework
func (*Zephyr) ServeHTTP ¶
func (z *Zephyr) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP is the HTTP Entry point for a Martini instance. Useful if you want to control your own HTTP server.
func (*Zephyr) SetAfterCompletion ¶
func (z *Zephyr) SetAfterCompletion(afterCompletion afterCompletionFunc)
SetAfterCompletion set afterCompletion.
func (*Zephyr) SetErrResp ¶
SetErrResp set default err response.
func (*Zephyr) SetPreHandler ¶
func (z *Zephyr) SetPreHandler(preHandler preHandlerFunc)
SetPreHandler set preHandler.
func (*Zephyr) SetProfile ¶
SetProfile set service profile
func (*Zephyr) SetWrapper ¶
func (z *Zephyr) SetWrapper(wrapper wrapperFuc)
SetWrapper set ResponseWriter wrapper
Click to show internal directories.
Click to hide internal directories.