Documentation ¶
Overview ¶
Package cieca is an in-memory Key-Value datastore for Go. The main purpose is to easily cache data in the RAM for a certain amount of time.
Index ¶
- type DataStore
- func (d *DataStore) Clean()
- func (d *DataStore) Delete(key string)
- func (d *DataStore) Expiration(key string) *time.Time
- func (d *DataStore) Get(key string) []byte
- func (d *DataStore) GetWithExist(key string) ([]byte, bool)
- func (d *DataStore) Set(key string, value []byte)
- func (d *DataStore) SetWithExpiration(key string, value []byte, expiration time.Duration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataStore ¶
type DataStore struct {
// contains filtered or unexported fields
}
DataStore is the datastore containing all the data.
func (*DataStore) Clean ¶
func (d *DataStore) Clean()
Clean clears the datastore. Not so thread-safe. Use with care.
func (*DataStore) Expiration ¶
Expiration gets the time of expiration of a key.
func (*DataStore) Get ¶
Get retrieves a value in the datastore. If it is not found, nil is returned.
func (*DataStore) GetWithExist ¶
GetWithExist retrieves the value of a key, and a boolean indicating whether the value existed in the store.
Click to show internal directories.
Click to hide internal directories.