Documentation ¶
Index ¶
- func Assert(val bool, err error)
- func AssertFunc(val bool, fn func())
- func FilterHandler(filter Filter, handler http.Handler) http.Handler
- func GetJSON(url string, v interface{}) error
- func Handle(pattern string, handler http.Handler, filters ...Filter)
- func HandleFunc(pattern string, hf func(http.ResponseWriter, *http.Request), filters ...Filter)
- func Handler(handler http.Handler, filters ...Filter) http.Handler
- func HandlerFunc(hf func(http.ResponseWriter, *http.Request), filters ...Filter) http.Handler
- func Hash(h hash.Hash, r io.Reader) ([]byte, int64, error)
- func HashFile(h hash.Hash, name string) ([]byte, int64, error)
- func MD5(r io.Reader) ([]byte, int64, error)
- func MD5File(name string) ([]byte, int64, error)
- func ParseJSON(req *http.Request, v interface{}) error
- func ParseXML(req *http.Request, v interface{}) error
- func PostJSON(url string, v interface{}) (*http.Response, error)
- func PostXML(url string, v interface{}) (*http.Response, error)
- func Serve(s Service)
- func Transform(src string) (string, error)
- type Filter
- type FilterFunc
- type MutexWrapper
- type Queue
- type RWMutexWrapper
- type Service
- type Stack
- type WaitGroupWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterHandler ¶
FilterHandler returns a new Handler which filters request before the Handler.
func HandleFunc ¶
HandleFunc is a easy way to call http.HandleFunc function.
func Handler ¶
Handler combine all Filters and the Handler into a new Handler which contains these Filters and calls Handler finally.
func HandlerFunc ¶
Handler combine all Filters and the HandlerFunc into a new Handler which contains these Filters and calls Handler finally.
func Hash ¶
Hash computes the content from reader by the provided hash function and return the checksum, content length, and error.
func HashFile ¶
Hash computes the content from file by the provided hash function and return the checksum, content length, and error.
Types ¶
type Filter ¶
Filter processes request before handler.
func Combine2Filters ¶
Combine2Filters combines 2 Filters into a single Filter.
func CombineFilters ¶
CombineFilters combines multi Filters into a single Filter.
type FilterFunc ¶
FilterFunc is a function as a Filter.
func (FilterFunc) Filter ¶
func (ff FilterFunc) Filter(w http.ResponseWriter, r *http.Request, next http.Handler)
Filter implements Filter interface.
type MutexWrapper ¶
func (*MutexWrapper) Wrap ¶
func (wrapper *MutexWrapper) Wrap(fn func())
type RWMutexWrapper ¶
func (*RWMutexWrapper) RWrap ¶
func (wrapper *RWMutexWrapper) RWrap(fn func())
func (*RWMutexWrapper) Wrap ¶
func (wrapper *RWMutexWrapper) Wrap(fn func())
type WaitGroupWrapper ¶
func (*WaitGroupWrapper) Wrap ¶
func (wrapper *WaitGroupWrapper) Wrap(fn func())