Documentation
¶
Overview ¶
Package sharedstore implements ext.SharedStore, the key/value store core hands to extensions, on the gateway's configured storage backend.
Index ¶
- Constants
- type Store
- func (s *Store) Close() error
- func (s *Store) Delete(ctx context.Context, namespace, key string) error
- func (s *Store) Get(ctx context.Context, namespace, key string) ([]byte, bool, error)
- func (s *Store) List(ctx context.Context, namespace string) ([]ext.SharedEntry, error)
- func (s *Store) Put(ctx context.Context, namespace, key string, value []byte, expiresAt time.Time) error
Constants ¶
const SweepInterval = time.Hour
SweepInterval is how often expired entries are deleted. Reads already hide them, so the sweep only bounds the table's size.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store validates calls, hides closed generations, and sweeps expired entries in front of a backend.
func New ¶
New opens the shared store on the gateway's storage connection and starts the expiry sweep. Close stops the sweep; the connection stays owned by the storage layer.
func (*Store) Close ¶
Close stops the sweep and fails every later call with ext.ErrSharedStoreClosed, so an extension still holding this generation's store never reaches a closed connection.