Documentation
¶
Index ¶
- Constants
- func ConfigStatic(pattern, prefix string, cache bool, suffixes ...string)
- func ConfigView(prefix, suffix string, cache bool)
- func DefaultHandler(handler Handler)
- func FilterAfter(pattern string, filterHandler FilterHandler)
- func FilterBefore(pattern string, filterHandler FilterHandler)
- func Interceptor(pattern string, interceptorHandler InterceptorHandler)
- func RequestNotSupportedHandler(handler Handler)
- func Route(pattern string, handler Handler)
- func RouteDelete(pattern string, handler Handler)
- func RouteGet(pattern string, handler Handler)
- func RoutePatch(pattern string, handler Handler)
- func RoutePost(pattern string, handler Handler)
- func RoutePut(pattern string, handler Handler)
- func Run(option *ServerOption)
- func RunWithFunc(option *ServerOption, cFunc func())
- func StaticDefaultHandler(staticHandler StaticHandler)
- func WebRoot(path string)
- type Context
- func (context *Context) GetParameter(name, defaultValue string) string
- func (context *Context) GetParameters(name string, defaultValue []string) []string
- func (context *Context) Handled() *HandlerResult
- func (context *Context) RenderBinary(buffer []byte)
- func (context *Context) RenderImage(buffer []byte)
- func (context *Context) RenderJSON(data interface{})
- func (context *Context) RenderText(text string)
- func (context *Context) RenderView(name string)
- type FilterContext
- type FilterHandler
- type Handler
- type HandlerResult
- type InterceptorContext
- type InterceptorHandler
- type InterceptorRouteMap
- type ServerOption
- type StaticHandler
- type StaticMap
- type StaticSuffixMap
Constants ¶
View Source
const ( PathPattern = iota UrlVarPattern )
Variables ¶
This section is empty.
Functions ¶
func ConfigStatic ¶
func ConfigView ¶
func DefaultHandler ¶
func DefaultHandler(handler Handler)
func FilterAfter ¶
func FilterAfter(pattern string, filterHandler FilterHandler)
func FilterBefore ¶
func FilterBefore(pattern string, filterHandler FilterHandler)
func Interceptor ¶
func Interceptor(pattern string, interceptorHandler InterceptorHandler)
func RequestNotSupportedHandler ¶
func RequestNotSupportedHandler(handler Handler)
func RouteDelete ¶
func RoutePatch ¶
func Run ¶
func Run(option *ServerOption)
func RunWithFunc ¶
func RunWithFunc(option *ServerOption, cFunc func())
func StaticDefaultHandler ¶
func StaticDefaultHandler(staticHandler StaticHandler)
Types ¶
type Context ¶
type Context struct { Request *http.Request RequestURI string RequestURL string RequestMethod string Writer http.ResponseWriter Header http.Header Cookies map[string][]*http.Cookie Multipart map[string][]*multipart.FileHeader Parameters map[string][]string }
func (*Context) GetParameter ¶
func (*Context) GetParameters ¶
func (*Context) Handled ¶
func (context *Context) Handled() *HandlerResult
func (*Context) RenderBinary ¶
func (*Context) RenderImage ¶
func (*Context) RenderJSON ¶
func (context *Context) RenderJSON(data interface{})
func (*Context) RenderText ¶
func (*Context) RenderView ¶
type FilterContext ¶
type FilterHandler ¶
type FilterHandler func(FilterContext)
type HandlerResult ¶
type HandlerResult struct {
Handled bool
}
type InterceptorContext ¶
type InterceptorContext struct {
Context
}
type InterceptorHandler ¶
type InterceptorHandler func(InterceptorContext) *HandlerResult
type InterceptorRouteMap ¶
type InterceptorRouteMap map[string]interceptorRoute
type ServerOption ¶
type StaticHandler ¶
type StaticHandler func(context Context, resourcePath string) *HandlerResult
type StaticSuffixMap ¶
Click to show internal directories.
Click to hide internal directories.