Documentation ¶
Index ¶
- Variables
- type ObjectStorage
- func (o *ObjectStorage) Delete(ctx context.Context, key string) error
- func (o *ObjectStorage) Get(ctx context.Context, key string) (olricstorage.Entry, error)
- func (o *ObjectStorage) KeyPrefix() string
- func (o *ObjectStorage) List(ctx context.Context, prefix string) (string, error)
- func (o *ObjectStorage) Put(_ context.Context, key string, data []byte, timestamp int64, ttl int64) error
- func (o *ObjectStorage) SetContextWithCancel(ctx context.Context, cancel context.CancelFunc)
- func (o *ObjectStorage) Start(ctx context.Context) error
- func (o *ObjectStorage) Stop(_ context.Context) error
- type ObjectStorageBackedDMap
- func (o *ObjectStorageBackedDMap) Delete(ctx context.Context, keys ...string) (int, error)
- func (o *ObjectStorageBackedDMap) Destroy(ctx context.Context) error
- func (o *ObjectStorageBackedDMap) Expire(ctx context.Context, key string, timeout time.Duration) error
- func (o *ObjectStorageBackedDMap) Function(ctx context.Context, label string, function string, arg []byte) ([]byte, error)
- func (o *ObjectStorageBackedDMap) Get(ctx context.Context, key string) (*olric.GetResponse, error)
- func (o *ObjectStorageBackedDMap) Lock(ctx context.Context, key string, deadline time.Duration) (olric.LockContext, error)
- func (o *ObjectStorageBackedDMap) LockWithTimeout(ctx context.Context, key string, timeout time.Duration, deadline time.Duration) (olric.LockContext, error)
- func (o *ObjectStorageBackedDMap) Name() string
- func (o *ObjectStorageBackedDMap) Put(ctx context.Context, key string, value interface{}, options ...olric.PutOption) (*olric.PutConfig, error)
- type ObjectStorageIface
- type Operation
- type PersistentEntry
- func (p *PersistentEntry) Decode(buf []byte)
- func (p *PersistentEntry) Encode() []byte
- func (p *PersistentEntry) Key() string
- func (p *PersistentEntry) LastAccess() int64
- func (p *PersistentEntry) SetKey(s string)
- func (p *PersistentEntry) SetLastAccess(i int64)
- func (p *PersistentEntry) SetTTL(i int64)
- func (p *PersistentEntry) SetTimestamp(i int64)
- func (p *PersistentEntry) SetValue(bytes []byte)
- func (p *PersistentEntry) TTL() int64
- func (p *PersistentEntry) Timestamp() int64
- func (p *PersistentEntry) Value() []byte
- type ProvideParams
Constants ¶
This section is empty.
Variables ¶
var ( // ErrKeyNotFound means that given key is not present in the object storage. ErrKeyNotFound = errors.New("key not found") )
Functions ¶
This section is empty.
Types ¶
type ObjectStorage ¶
type ObjectStorage struct {
// contains filtered or unexported fields
}
ObjectStorage is an ObjectStorageIface implementation using GCP storage.
func (*ObjectStorage) Delete ¶
func (o *ObjectStorage) Delete(ctx context.Context, key string) error
Delete queues delete operation from object storage.
func (*ObjectStorage) Get ¶
func (o *ObjectStorage) Get(ctx context.Context, key string) (olricstorage.Entry, error)
Get gets object from object storage.
func (*ObjectStorage) Put ¶
func (o *ObjectStorage) Put( _ context.Context, key string, data []byte, timestamp int64, ttl int64, ) error
Put queues put operation to object storage.
func (*ObjectStorage) SetContextWithCancel ¶
func (o *ObjectStorage) SetContextWithCancel(ctx context.Context, cancel context.CancelFunc)
SetContextWithCancel sets long-running context and cancel function.
type ObjectStorageBackedDMap ¶
type ObjectStorageBackedDMap struct {
// contains filtered or unexported fields
}
ObjectStorageBackedDMap is a wrapper around olric.DMap with a second layer persistent storage.
func NewPersistentDMap ¶
func NewPersistentDMap( dmap olric.DMap, defaultTTL time.Duration, backingStorage ObjectStorageIface, prometheusRegistry *prometheus.Registry, getDistCacheLabels func() (prometheus.Labels, bool), ) (*ObjectStorageBackedDMap, error)
NewPersistentDMap returns new persistent dmap.
func (*ObjectStorageBackedDMap) Destroy ¶
func (o *ObjectStorageBackedDMap) Destroy(ctx context.Context) error
Destroy destroys persistent dmap.
func (*ObjectStorageBackedDMap) Expire ¶
func (o *ObjectStorageBackedDMap) Expire(ctx context.Context, key string, timeout time.Duration) error
Expire deletes key from backing storage and expires it in in-memory storage.
func (*ObjectStorageBackedDMap) Function ¶
func (o *ObjectStorageBackedDMap) Function(ctx context.Context, label string, function string, arg []byte) ([]byte, error)
Function executes function on dmap.
func (*ObjectStorageBackedDMap) Get ¶
func (o *ObjectStorageBackedDMap) Get(ctx context.Context, key string) (*olric.GetResponse, error)
Get tries to get key from in-memory storage and then from backing storage if that fails.
func (*ObjectStorageBackedDMap) Lock ¶
func (o *ObjectStorageBackedDMap) Lock(ctx context.Context, key string, deadline time.Duration) (olric.LockContext, error)
Lock locks dmap.
func (*ObjectStorageBackedDMap) LockWithTimeout ¶
func (o *ObjectStorageBackedDMap) LockWithTimeout(ctx context.Context, key string, timeout time.Duration, deadline time.Duration) (olric.LockContext, error)
LockWithTimeout locks dmap with timeout.
func (*ObjectStorageBackedDMap) Name ¶
func (o *ObjectStorageBackedDMap) Name() string
Name of the dmap.
type ObjectStorageIface ¶
type ObjectStorageIface interface { KeyPrefix() string SetContextWithCancel(ctx context.Context, cancel context.CancelFunc) Start(ctx context.Context) error Stop(ctx context.Context) error Put(ctx context.Context, key string, data []byte, timestamp, ttl int64) error Get(ctx context.Context, key string) (olricstorage.Entry, error) Delete(ctx context.Context, key string) error List(ctx context.Context, prefix string) (string, error) }
ObjectStorageIface is an abstract over persistent storage for Olric DMap.
type Operation ¶
type Operation struct {
// contains filtered or unexported fields
}
Operation executed on object storage.
type PersistentEntry ¶
type PersistentEntry struct {
// contains filtered or unexported fields
}
PersistentEntry is an implementation of Olric entry used for persistent storage.
func (*PersistentEntry) LastAccess ¶
func (p *PersistentEntry) LastAccess() int64
LastAccess is a last access getter.
func (*PersistentEntry) SetLastAccess ¶
func (p *PersistentEntry) SetLastAccess(i int64)
SetLastAccess is a last access setter.
func (*PersistentEntry) SetTimestamp ¶
func (p *PersistentEntry) SetTimestamp(i int64)
SetTimestamp is a timestamp setter.
func (*PersistentEntry) SetValue ¶
func (p *PersistentEntry) SetValue(bytes []byte)
SetValue is a value setter.
func (*PersistentEntry) Timestamp ¶
func (p *PersistentEntry) Timestamp() int64
Timestamp is a timestamp getter.
type ProvideParams ¶
type ProvideParams struct { fx.In AgentInfo *agentinfo.AgentInfo Lifecycle fx.Lifecycle Unmarshaller config.Unmarshaller }
ProvideParams for object storage.