Documentation
¶
Overview ¶
Foliage statefun cache package. Provides cache system that lives between stateful functions and NATS key/value
Index ¶
- Constants
- type Config
- type KeyValue
- type Store
- func (cs *Store) DeleteValue(key string, updateInKV bool, customDeleteTime int64, transactionID string)
- func (cs *Store) Destroy()
- func (cs *Store) GetKeysByPattern(pattern string) []string
- func (cs *Store) GetValue(key string) ([]byte, error)
- func (cs *Store) GetValueAsJSON(key string) (*easyjson.JSON, error)
- func (cs *Store) GetValueUpdateTime(key string) int64
- func (cs *Store) SetValue(key string, value []byte, updateInKV bool, customSetTime int64, ...) bool
- func (cs *Store) SetValueIfDoesNotExist(key string, newValue []byte, updateInKV bool, customSetTime int64) bool
- func (cs *Store) SubscribeLevelCallback(key string, callbackID string) chan KeyValue
- func (cs *Store) TransactionBegin(transactionID string)
- func (cs *Store) TransactionEnd(transactionID string)
- func (cs *Store) UnsubscribeLevelCallback(key string, callbackID string)
- type StoreValue
- func (csv *StoreValue) ConsistencyLoss(lossTime int64)
- func (csv *StoreValue) Delete(updateInKV bool, customDeleteTime int64)
- func (csv *StoreValue) GetFullKeyString() string
- func (csv *StoreValue) LoadChild(key interface{}, safe bool) (*StoreValue, bool)
- func (csv *StoreValue) Lock(caller string)
- func (csv *StoreValue) Put(value interface{}, updateInKV bool, customPutTime int64)
- func (csv *StoreValue) Range(f func(key, value interface{}) bool)
- func (csv *StoreValue) StoreChild(key interface{}, child *StoreValue, safe bool)
- func (csv *StoreValue) TryPurgeConfirm(safe bool) bool
- func (csv *StoreValue) TryPurgeReady(safe bool) bool
- func (csv *StoreValue) Unlock(caller string)
- func (csv *StoreValue) ValueExists() bool
- type Transaction
- type TransactionOperator
Constants ¶
View Source
const ( KVStorePrefix = "store" LRUSize = 1000000 LevelSubscriptionNotificationsBufferMaxSize = 30000 // ~16Mb: elemenets := 16 * 1024 * 1024 / (64 + 512), where 512 - avg value size, 64 - avg key size )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func NewCacheConfig ¶
func (*Config) SetKVStorePrefix ¶
func (*Config) SetLRUSize ¶
func (*Config) SetLevelSubscriptionNotificationsBufferMaxSize ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewCacheStore ¶
func (*Store) DeleteValue ¶
func (*Store) GetKeysByPattern ¶
func (*Store) GetValueUpdateTime ¶
func (*Store) SetValueIfDoesNotExist ¶
func (*Store) SubscribeLevelCallback ¶
key - level callback key, for e.g. "a.b.c.*" callbackID - unique id for this subscription
func (*Store) TransactionBegin ¶
func (*Store) TransactionEnd ¶
func (*Store) UnsubscribeLevelCallback ¶
type StoreValue ¶
type StoreValue struct {
// contains filtered or unexported fields
}
func (*StoreValue) ConsistencyLoss ¶
func (csv *StoreValue) ConsistencyLoss(lossTime int64)
func (*StoreValue) Delete ¶
func (csv *StoreValue) Delete(updateInKV bool, customDeleteTime int64)
func (*StoreValue) GetFullKeyString ¶
func (csv *StoreValue) GetFullKeyString() string
func (*StoreValue) LoadChild ¶
func (csv *StoreValue) LoadChild(key interface{}, safe bool) (*StoreValue, bool)
func (*StoreValue) Lock ¶
func (csv *StoreValue) Lock(caller string)
func (*StoreValue) Put ¶
func (csv *StoreValue) Put(value interface{}, updateInKV bool, customPutTime int64)
func (*StoreValue) Range ¶
func (csv *StoreValue) Range(f func(key, value interface{}) bool)
func (*StoreValue) StoreChild ¶
func (csv *StoreValue) StoreChild(key interface{}, child *StoreValue, safe bool)
func (*StoreValue) TryPurgeConfirm ¶
func (csv *StoreValue) TryPurgeConfirm(safe bool) bool
func (*StoreValue) TryPurgeReady ¶
func (csv *StoreValue) TryPurgeReady(safe bool) bool
func (*StoreValue) Unlock ¶
func (csv *StoreValue) Unlock(caller string)
func (*StoreValue) ValueExists ¶
func (csv *StoreValue) ValueExists() bool
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
type TransactionOperator ¶
type TransactionOperator struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.