Documentation ¶
Index ¶
- type KeyValue
- type PGKeyValueStore
- func (c *PGKeyValueStore) Load(ctx *armadacontext.Context, keys []string) (map[string][]byte, error)
- func (c *PGKeyValueStore) PeriodicCleanup(ctx *armadacontext.Context, interval time.Duration, lifespan time.Duration) error
- func (c *PGKeyValueStore) Store(ctx *armadacontext.Context, kvs map[string][]byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PGKeyValueStore ¶
type PGKeyValueStore struct {
// contains filtered or unexported fields
}
PGKeyValueStore is a time-limited key-value store backed by postgres with a local LRU cache. The store is write-only, i.e., writing to an existing key will return an error (of type *armadaerrors.ErrAlreadyExists). Keys can only be deleted by running the cleanup function. Deleting keys does not cause caches to update, i.e., nodes may have an inconsistent view if keys are deleted.
func New ¶
func New(ctx *armadacontext.Context, db *pgxpool.Pool, tableName string) (*PGKeyValueStore, error)
func (*PGKeyValueStore) Load ¶ added in v0.3.89
func (c *PGKeyValueStore) Load(ctx *armadacontext.Context, keys []string) (map[string][]byte, error)
func (*PGKeyValueStore) PeriodicCleanup ¶
func (c *PGKeyValueStore) PeriodicCleanup(ctx *armadacontext.Context, interval time.Duration, lifespan time.Duration) error
PeriodicCleanup starts a goroutine that automatically runs the cleanup job every interval until the provided context is cancelled.
func (*PGKeyValueStore) Store ¶ added in v0.3.89
func (c *PGKeyValueStore) Store(ctx *armadacontext.Context, kvs map[string][]byte) error
Click to show internal directories.
Click to hide internal directories.