Documentation ¶
Overview ¶
Package cache a low-level key/value store in pure Go
Index ¶
- Variables
- func NewCache(opt Options) (cloudcat.Cache, error)
- func NewCookie(opt Options) (cloudcat.Cookie, error)
- type Cache
- type Cookie
- type DB
- func (db *DB) Close() error
- func (db *DB) Delete(key []byte) error
- func (db *DB) DeleteBatch(keys [][]byte) error
- func (db *DB) Get(key []byte) (value []byte, err error)
- func (db *DB) Put(key, value []byte) (err error)
- func (db *DB) PutWithTimeout(key, value []byte, timeout time.Duration) (err error)
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // CachePath the default db path CachePath = "cache" // ErrKeyNotFound not found the key ErrKeyNotFound = errors.New("key not found") )
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is an implementation of Cache that stores bytes in bolt.DB.
type Cookie ¶
type Cookie struct {
// contains filtered or unexported fields
}
Cookie is an implementation of cache.Cookie that stores http.Cookie in bolt.DB.
func (*Cookie) CookieString ¶
CookieString returns the cookies string for the given URL.
func (*Cookie) DeleteCookie ¶
DeleteCookie delete the cookies for the given URL.
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB a bbolt.DB instance
func (*DB) DeleteBatch ¶
DeleteBatch delete data in batch.
Click to show internal directories.
Click to hide internal directories.