Documentation ¶
Index ¶
- Variables
- func ClearAfterMethodName()
- func ClearBeforeMethodName()
- func Close()
- func Error(w http.ResponseWriter, error string, code int, headers ...Header)
- func GetAfterMethodName() []string
- func GetBeforeMethodName() []string
- func GetDefaultMethodName() string
- func GetDelimiterStyle() byte
- func GetFilterMethodNameAndHTTPMethodName(methodName string) (string, string)
- func GetFilterPrefix() string
- func GetHTTPMethodNamePrefix() string
- func Handle(pattern string, handler http.Handler)
- func HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
- func Handler(req *http.Request) (h http.Handler, pattern string)
- func Injector(name, follower string, priority uint, ...)
- func ListenAndServe(addr string, handler http.Handler) error
- func ListenAndServeTLS(addr, certFile, keyFile string, handler http.Handler) error
- func MakePattern(method string) string
- func NotFoundHandler(error string)
- func NotFoundHtmlHandler(error string)
- func Register(patternRoot string, i interface{})
- func Registers() map[string]register
- func Releasor(name, leader string, lag uint, ...)
- func ServeHTTP(w http.ResponseWriter, req *http.Request)
- func SetAfterMethodName(methodName string)
- func SetBeforeMethodName(methodName string)
- func SetCloser(fn func())
- func SetDefaultMethodName(methodName string)
- func SetDelimiterStyle(delimiterStyle byte)
- func SetFilterPrefix(filterPrefix string)
- func SetHTTPMethodNamePrefix(methodNamePrefix string)
- type Header
- type Manager
- func (rm *Manager) ClearAfterMethodName() *Manager
- func (rm *Manager) ClearBeforeMethodName() *Manager
- func (rm *Manager) Close()
- func (rm *Manager) GetAfterMethodName() []string
- func (rm *Manager) GetBeforeMethodName() []string
- func (rm *Manager) GetDefaultMethodName() string
- func (rm *Manager) GetDelimiterStyle() byte
- func (rm *Manager) GetFilterMethodNameAndHTTPMethodName(methodName string) (filterMethodName, httpMethodName string)
- func (rm *Manager) GetFilterPrefix() string
- func (rm *Manager) GetHTTPMethodNamePrefix() string
- func (rm *Manager) Handler(r *http.Request) (h http.Handler, pattern string)
- func (rm *Manager) Injector(name, follower string, priority uint, ...)
- func (rm *Manager) NotFoundHandler(errstr string)
- func (rm *Manager) NotFoundHtmlHandler(errstr string)
- func (rm *Manager) Register(patternRoot string, i interface{})
- func (rm *Manager) Registers() map[string]register
- func (rm *Manager) Releasor(name, leader string, lag uint, ...)
- func (rm *Manager) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (rm *Manager) SetAfterMethodName(methodName string) *Manager
- func (rm *Manager) SetBeforeMethodName(methodName string) *Manager
- func (rm *Manager) SetCloser(fn func())
- func (rm *Manager) SetDefaultMethodName(methodName string) *Manager
- func (rm *Manager) SetDelimiterStyle(delimiterStyle byte) *Manager
- func (rm *Manager) SetFilterPrefix(filterPrefix string) *Manager
- func (rm *Manager) SetHTTPMethodNamePrefix(methodNamePrefix string) *Manager
- type ResponseWriter
- func (rw *ResponseWriter) GetData(key string) (interface{}, bool)
- func (rw *ResponseWriter) GetResData() []byte
- func (rw *ResponseWriter) Header() http.Header
- func (rw *ResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
- func (rw *ResponseWriter) SetData(key string, value interface{})
- func (rw *ResponseWriter) SetGetResData(getResData bool)
- func (rw *ResponseWriter) Write(b []byte) (int, error)
- func (rw *ResponseWriter) WriteHeader(statusCode int)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultRouter = NewManager() DefaultServer = http.Server{ ReadTimeout: 1 * time.Minute, WriteTimeout: 1 * time.Minute, } )
View Source
var (
CtHTMLHeader = Header{"Content-Type", []string{"text/html; charset=utf-8"}}
)
Functions ¶
func ClearAfterMethodName ¶
func ClearAfterMethodName()
func ClearBeforeMethodName ¶
func ClearBeforeMethodName()
func GetAfterMethodName ¶
func GetAfterMethodName() []string
func GetBeforeMethodName ¶
func GetBeforeMethodName() []string
func GetDefaultMethodName ¶
func GetDefaultMethodName() string
func GetDelimiterStyle ¶
func GetDelimiterStyle() byte
func GetFilterPrefix ¶
func GetFilterPrefix() string
func GetHTTPMethodNamePrefix ¶
func GetHTTPMethodNamePrefix() string
func HandleFunc ¶
func HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
func ListenAndServeTLS ¶
func MakePattern ¶
func NotFoundHandler ¶
func NotFoundHandler(error string)
func NotFoundHtmlHandler ¶
func NotFoundHtmlHandler(error string)
func SetAfterMethodName ¶
func SetAfterMethodName(methodName string)
func SetBeforeMethodName ¶
func SetBeforeMethodName(methodName string)
func SetDefaultMethodName ¶
func SetDefaultMethodName(methodName string)
func SetDelimiterStyle ¶
func SetDelimiterStyle(delimiterStyle byte)
func SetFilterPrefix ¶
func SetFilterPrefix(filterPrefix string)
func SetHTTPMethodNamePrefix ¶
func SetHTTPMethodNamePrefix(methodNamePrefix string)
Types ¶
type Manager ¶
func NewManager ¶
func NewManager() *Manager
func (*Manager) ClearAfterMethodName ¶
func (*Manager) ClearBeforeMethodName ¶
func (*Manager) GetAfterMethodName ¶
func (*Manager) GetBeforeMethodName ¶
func (*Manager) GetDefaultMethodName ¶
func (*Manager) GetDelimiterStyle ¶
func (*Manager) GetFilterMethodNameAndHTTPMethodName ¶
func (*Manager) GetFilterPrefix ¶
func (*Manager) GetHTTPMethodNamePrefix ¶
func (*Manager) NotFoundHandler ¶
func (*Manager) NotFoundHtmlHandler ¶
func (*Manager) Register ¶
Priority:
1. [<beforeMethodName>_method] | [beforeMethodName]
2. [method]
3. [http_<method>_method]
4. [<afterMethodName>_method] | [afterMethodName]
func (*Manager) ServeHTTP ¶
func (rm *Manager) ServeHTTP(w http.ResponseWriter, r *http.Request)
processing order: injector > handler > releasor
func (*Manager) SetAfterMethodName ¶
func (*Manager) SetBeforeMethodName ¶
func (*Manager) SetDefaultMethodName ¶
func (*Manager) SetDelimiterStyle ¶
func (*Manager) SetFilterPrefix ¶
if filterPrefix value is '@' that mean not to filter, but it is has hidden danger, so you kown what to do.
func (*Manager) SetHTTPMethodNamePrefix ¶
type ResponseWriter ¶
type ResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
func (*ResponseWriter) GetData ¶
func (rw *ResponseWriter) GetData(key string) (interface{}, bool)
func (*ResponseWriter) GetResData ¶
func (rw *ResponseWriter) GetResData() []byte
func (*ResponseWriter) Header ¶
func (rw *ResponseWriter) Header() http.Header
func (*ResponseWriter) Hijack ¶
func (rw *ResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
func (*ResponseWriter) SetData ¶
func (rw *ResponseWriter) SetData(key string, value interface{})
func (*ResponseWriter) SetGetResData ¶
func (rw *ResponseWriter) SetGetResData(getResData bool)
func (*ResponseWriter) WriteHeader ¶
func (rw *ResponseWriter) WriteHeader(statusCode int)
Click to show internal directories.
Click to hide internal directories.