Documentation
¶
Index ¶
- Constants
- func Cache(store CStore, expire time.Duration) gin.HandlerFunc
- type CStore
- type DBStore
- func (c *DBStore) Add(key string, value interface{}, expires time.Duration) error
- func (c *DBStore) Decrement(key string, delta uint64) (uint64, error)
- func (c *DBStore) Delete(key string) error
- func (c *DBStore) Flush() error
- func (c *DBStore) Get(key string, value interface{}) (err error)
- func (c *DBStore) Increment(key string, delta uint64) (uint64, error)
- func (z DBStore) MarshalMsg(b []byte) (o []byte, err error)
- func (z DBStore) Msgsize() (s int)
- func (c *DBStore) Replace(key string, value interface{}, expires time.Duration) error
- func (c *DBStore) Set(key string, value interface{}, expires time.Duration) (err error)
- func (z *DBStore) UnmarshalMsg(bts []byte) (o []byte, err error)
- type DBStoreItem
- type FileStore
- func (c *FileStore) Add(key string, value interface{}, expires time.Duration) error
- func (c *FileStore) Decrement(key string, delta uint64) (uint64, error)
- func (c *FileStore) Delete(key string) error
- func (c *FileStore) Flush() error
- func (c *FileStore) Get(key string, value interface{}) error
- func (c *FileStore) Increment(key string, delta uint64) (uint64, error)
- func (c *FileStore) Replace(key string, value interface{}, expires time.Duration) error
- func (c *FileStore) Set(key string, value interface{}, expires time.Duration) error
- type ResponseCache
Constants ¶
View Source
const ( // DEFAULT ... DEFAULT = time.Duration(0) // FOREVER ... FOREVER = time.Duration(-1) // CacheMiddlewareKey ... CacheMiddlewareKey = "gincontrib.cache" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CStore ¶
type CStore interface {
Get(key string, value interface{}) error
Set(key string, value interface{}, expire time.Duration) error
Add(key string, value interface{}, expire time.Duration) error
Replace(key string, data interface{}, expire time.Duration) error
Delete(key string) error
Increment(key string, data uint64) (uint64, error)
Decrement(key string, data uint64) (uint64, error)
Flush() error
}
CStore ...
type DBStore ¶
type DBStore struct {
// contains filtered or unexported fields
}
DBStore ...
func NewDBStore ¶
func NewDBStore() *DBStore
NewDBStore Returns instance of BoltDB backed cache store
func (DBStore) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (DBStore) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
type DBStoreItem ¶
type DBStoreItem struct {
Key string `json:"key"`
Value interface{} `json:"value"`
}
DBStoreItem ...
func (DBStoreItem) MarshalMsg ¶
func (z DBStoreItem) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (DBStoreItem) Msgsize ¶
func (z DBStoreItem) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*DBStoreItem) UnmarshalMsg ¶
func (z *DBStoreItem) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
Click to show internal directories.
Click to hide internal directories.