Documentation
¶
Index ¶
Constants ¶
View Source
const ( Word = ":word" Number = ":number" Any = ":any" )
View Source
const (
BrowserCacheLifeTimeWeek = 604800 // week 7 days
)
View Source
const (
EncodingCharsetUTF8 = "utf-8"
)
View Source
const MaxFormSizeMemory = 10 << 20
Variables ¶
This section is empty.
Functions ¶
func Predefined ¶ added in v0.0.9
Types ¶
type HTTPAnswer ¶ added in v0.0.9
type HTTPAnswer struct { // Configure //-------------------------- GZipped bool BrowserCached bool ETagUsed bool GZipLevel int // gzip.BestCompression BrowserCacheLifeTime int Encoding string HTTPCORSHeaders HTTPCORSHeaders // Data //-------------------------- ResponseCode int Content interface{} ContentType string ETag string }
func (*HTTPAnswer) Send ¶ added in v0.0.9
func (answer *HTTPAnswer) Send(w http.ResponseWriter, r *http.Request) error
type HTTPCORSHeaders ¶ added in v0.0.61
type HTTPRegexp ¶ added in v0.0.9
Регулярные выражения для проверки роутов
func (*HTTPRegexp) Add ¶ added in v0.0.9
func (reg *HTTPRegexp) Add(pattern, regExpPattern string)
func (*HTTPRegexp) AddPredefined ¶ added in v0.0.9
func (reg *HTTPRegexp) AddPredefined(predefined []string)
func (*HTTPRegexp) Init ¶ added in v0.0.9
func (reg *HTTPRegexp) Init()
func (*HTTPRegexp) MatchURIParts ¶ added in v0.0.9
func (reg *HTTPRegexp) MatchURIParts(routeURIParts, requestURLParts []string) bool
type HTTPRoute ¶ added in v0.0.9
type HTTPRoute struct { Method string URI string F HandlerFunc }
Один Роут и методы его сравнения
func (*HTTPRoute) MatchMethod ¶ added in v0.0.9
type HTTPRouter ¶ added in v0.0.9
type HTTPRouter struct { Logger *zap.Logger Routes []HTTPRoute DefaultNotFoundAnswer HTTPAnswer HTTPRegexp }
func (*HTTPRouter) HandleFunc ¶ added in v0.0.9
func (router *HTTPRouter) HandleFunc(method, uri string, f HandlerFunc)
func (*HTTPRouter) Init ¶ added in v0.0.9
func (router *HTTPRouter) Init()
func (*HTTPRouter) ServeHTTP ¶ added in v0.0.9
func (router *HTTPRouter) ServeHTTP(w http.ResponseWriter, r *http.Request)
type HandlerFunc ¶ added in v0.0.39
type HandlerFunc func(http.ResponseWriter, *http.Request) error
Click to show internal directories.
Click to hide internal directories.