Documentation
¶
Index ¶
- Variables
- func IsMethod(r *http.Request, method ...string) bool
- func MethodFiliter(w http.ResponseWriter, r *http.Request, method ...string) (pass bool)
- func NewLimitItem(max int) *limitItem
- func NotModified(r *http.Request, w http.ResponseWriter, modTime time.Time) (notMod bool)
- func NotModifiedDur(r *http.Request, w http.ResponseWriter, modDur time.Duration) (notMod bool)
- func WithBr(w http.ResponseWriter, r *http.Request) (wf io.Writer, close func() error)
- func WithDeflate(w http.ResponseWriter, r *http.Request) (wf io.Writer, close func() error)
- func WithEncoding(w http.ResponseWriter, r *http.Request) (wf io.Writer, close func() error)
- func WithFlush(w http.ResponseWriter) http.ResponseWriter
- func WithGzip(w http.ResponseWriter, r *http.Request) (wf io.Writer, close func() error)
- func WithStatusCode(w http.ResponseWriter, code int)
- func WithZstd(w http.ResponseWriter, r *http.Request) (wf io.Writer, close func() error)
- type Cachedeprecated
- type Exprier
- func (t *Exprier) Check(key string) (time.Time, error)
- func (t *Exprier) Disable()
- func (t *Exprier) Drop(key string)
- func (t *Exprier) Len() int
- func (t *Exprier) LoopCheck(ctx context.Context, key string, whenfail func(key string, e error)) (e error)
- func (t *Exprier) Reg(dur time.Duration, reNewKey ...string) (string, error)
- func (t *Exprier) SetMax(max int)
- type Handler
- type Limits
- type Web
- type WebPath
- func (t *WebPath) Delete(path string) (deleteMe bool)
- func (t *WebPath) GetConn(r *http.Request) net.Conn
- func (t *WebPath) Load(path string) (func(w http.ResponseWriter, r *http.Request), bool)
- func (t *WebPath) LoadOnePerfix(path string) (f func(w http.ResponseWriter, r *http.Request), ok bool)
- func (t *WebPath) LoadPerfix(path string) (f func(w http.ResponseWriter, r *http.Request), ok bool)
- func (t *WebPath) Reset()
- func (t *WebPath) Store(path string, f func(w http.ResponseWriter, r *http.Request))
- func (t *WebPath) StoreIfNotExist(path string, f func(w http.ResponseWriter, r *http.Request))
- type WebSync
- type WithCacheWiter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrExpried = errors.New("ErrExpried") ErrNoFound = errors.New("ErrNoFound") )
Functions ¶
func MethodFiliter ¶ added in v0.28.20251229180712
func NewLimitItem ¶ added in v0.27.16
func NewLimitItem(max int) *limitItem
func NotModified ¶ added in v0.28.20240721121146
当请求时间戳与modTime相同时,返回304,true
func NotModifiedDur ¶ added in v0.28.20251115121651
当请求时间戳在modDur之内时,返回304,true
func WithDeflate ¶ added in v0.28.20260101005913
func WithEncoding ¶ added in v0.28.20260101005913
func WithFlush ¶ added in v0.28.1
func WithFlush(w http.ResponseWriter) http.ResponseWriter
func WithStatusCode ¶ added in v0.27.16
func WithStatusCode(w http.ResponseWriter, code int)
Types ¶
type Cache
deprecated
added in
v0.27.13
type Cache struct {
// contains filtered or unexported fields
}
Deprecated: use NotModifiedDur
func (*Cache) Cache
deprecated
added in
v0.27.15
func (t *Cache) Cache(key string, aliveDur time.Duration, w http.ResponseWriter) http.ResponseWriter
Deprecated: use NotModifiedDur
type Exprier ¶ added in v0.28.20240107072530
type Exprier struct {
// contains filtered or unexported fields
}
func NewExprier ¶ added in v0.28.20240107072530
type Handler ¶ added in v0.28.20250328130819
type Handler struct {
DealF func(path string) (func(w http.ResponseWriter, r *http.Request), bool)
}
func NewHandler ¶ added in v0.28.20250328130819
type Limits ¶ added in v0.27.16
type Limits struct {
// contains filtered or unexported fields
}
func (*Limits) AddLimitItem ¶ added in v0.27.16
func (t *Limits) AddLimitItem(item *limitItem)
type WebPath ¶ added in v0.22.4
type WebPath struct {
Path string `json:"path"`
PerSame *WebPath `json:"-"`
Per *WebPath `json:"-"`
Same *WebPath `json:"same"`
Next *WebPath `json:"next"`
// contains filtered or unexported fields
}
func (*WebPath) Load ¶ added in v0.22.4
O /../../1 => /../../1
X /../../1 => /../../
X /../../1 => /../
func (*WebPath) LoadOnePerfix ¶ added in v0.28.20240309172046
func (t *WebPath) LoadOnePerfix(path string) (f func(w http.ResponseWriter, r *http.Request), ok bool)
O /../../1 => /../../1
O /../../1 => /../../
X /../../1 => /../
func (*WebPath) LoadPerfix ¶ added in v0.28.20231202144738
O /../../1 => /../../1
O /../../1 => /../../
O /../../1 => /../
func (*WebPath) StoreIfNotExist ¶ added in v0.28.20250927160950
type WebSync ¶ added in v0.22.4
func NewSyncMap ¶ added in v0.22.1
type WithCacheWiter ¶ added in v0.28.20250204153805
type WithCacheWiter struct {
// contains filtered or unexported fields
}
func WithCache ¶ added in v0.28.20250125173504
func WithCache(w http.ResponseWriter, maxWait uint32) *WithCacheWiter
func (*WithCacheWiter) Header ¶ added in v0.28.20250204153805
func (t *WithCacheWiter) Header() http.Header
func (*WithCacheWiter) Write ¶ added in v0.28.20250204153805
func (t *WithCacheWiter) Write(b []byte) (i int, e error)
func (*WithCacheWiter) WriteHeader ¶ added in v0.28.20250204153805
func (t *WithCacheWiter) WriteHeader(i int)
Click to show internal directories.
Click to hide internal directories.