Documentation
¶
Overview ¶
Package dynamo implements store.Store on a single DynamoDB table (hash key "pk", range key "sk", TTL attribute "expireAt"). The caller constructs and owns the *dynamodb.Client, so credentials, region, and endpoint (production or DynamoDB-local) stay a deployment concern.
TTL caveat: DynamoDB deletes expired items lazily, so expired records can remain visible for a time. Services already tolerate this (per the store.Record contract); windowed keys (RATE#.../HOUR#13) carry the exact semantics.
Index ¶
- type Store
- func (s *Store) Delete(ctx context.Context, r store.Record, cond store.Cond) error
- func (s *Store) Get(ctx context.Context, k store.Key) (store.Record, error)
- func (s *Store) Increment(ctx context.Context, k store.Key, delta int64, expireAt time.Time) (int64, error)
- func (s *Store) Put(ctx context.Context, r store.Record, cond store.Cond) (store.Record, error)
- func (s *Store) Query(ctx context.Context, pk, skPrefix string, opt store.QueryOpt) iter.Seq2[store.Record, error]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements store.Store on one DynamoDB table.
func (*Store) Increment ¶
func (s *Store) Increment(ctx context.Context, k store.Key, delta int64, expireAt time.Time) (int64, error)
Increment atomically adds delta to the counter at k.
Click to show internal directories.
Click to hide internal directories.