Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CacheHandler ¶
type CacheHandler interface { PutItem(w http.ResponseWriter, r *http.Request) PutItemWithKey(w http.ResponseWriter, r *http.Request) GetItem(w http.ResponseWriter, r *http.Request) DeleteItem(w http.ResponseWriter, r *http.Request) ListItem(w http.ResponseWriter, r *http.Request) GetStats(w http.ResponseWriter, r *http.Request) GetStatus(w http.ResponseWriter, r *http.Request) }
CacheHandler combines several methods those implement http.Handler.
func NewCacheHandler ¶
func NewCacheHandler(cs CacheService) CacheHandler
NewCacheHandler returns a new CacheHandler.
type CacheService ¶
type CacheService interface { Set(key string, v []byte) error SetAndGenerateUUID(v []byte) (string, error) Get(key string) (Item, error) Delete(key string) error List() ([]Item, error) Stats() bigcache.Stats Len() int Capacity() int }
CacheService provides function for cache.
func NewCacheService ¶
func NewCacheService(config bigcache.Config) CacheService
NewCacheService returns a new CacheService.
Click to show internal directories.
Click to hide internal directories.