Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cacher ¶
type Cacher interface {
FetchData(
class string,
dependencies map[string]string,
dst interface{},
builder func() (interface{}, error),
lifeTime time.Duration,
) error
FetchHtml(
class string,
dependencies map[string]string,
builder func() (tpl Template, data interface{}, err error),
lifeTime time.Duration,
) (html string, err error)
// Invalidate depended data
Invalidate(key, val string) error
}
type Storage ¶
type Storage interface {
// Lock key
Lock(key string)
// Unlock key
Unlock(key string)
// Get value by key. Returns data.ErrNoMatch, if has no key.
Get(key string, dst interface{}) error
// Set value with key and expire time.
Set(key string, val interface{}, timeout time.Duration) error
// Delete cached value by key.
Delete(key string) error
// Assert depended key
Assert(key string, dependencies map[string]string) error
// Invalidate depended data
Invalidate(key, val string) error
}
Click to show internal directories.
Click to hide internal directories.