Documentation
¶
Index ¶
- Constants
- Variables
- type Fn
- type FnHijack
- type Group
- func (g *Group) Do(key string, fn Fn) (interface{}, error)
- func (g *Group) DoWithCondition(key string, fn Fn, shouldCache ShouldCache) (interface{}, error)
- func (g *Group) HijackDo(key string, fn FnHijack) (interface{}, error)
- func (g *Group) HijackDoWithCondition(key string, fn FnHijack, shouldCache ShouldCache) (interface{}, error)
- func (g *Group) NoSingleFlight() *Group
- type ShouldCache
Constants ¶
View Source
const ( DefaultCacheDirty = time.Minute * 5 DefaultCacheExpiration = time.Minute * 1 )
Variables ¶
View Source
var ErrUnmodified = errors.New("cacheflight: unmodified")
Functions ¶
This section is empty.
Types ¶
type FnHijack ¶
- sometimes you may need the oldVal to do logic. eg. consider a case like http 304(Not modified), server is told the oldVal's hash to decide if it's modified
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func (*Group) DoWithCondition ¶
func (g *Group) DoWithCondition(key string, fn Fn, shouldCache ShouldCache) (interface{}, error)
func (*Group) HijackDoWithCondition ¶
func (g *Group) HijackDoWithCondition(key string, fn FnHijack, shouldCache ShouldCache) (interface{}, error)
func (*Group) NoSingleFlight ¶
Click to show internal directories.
Click to hide internal directories.