Documentation
¶
Overview ¶
Package memory is an in-process dict driver backed by a sync.Map.
Intended use: unit tests and short-lived dev runs of the standalone binary where persistence is not required. State is lost on process exit. NOT suitable for production: gives no durability guarantees, no cross-process visibility (use file/redis/sql for that).
Configuration: no settings — instantiating with Driver:"memory" is enough. TTL is honoured at lookup/iterate time (lazy expiration); ExpireScan walks the map and purges anything past its deadline.
Index ¶
- func New(_ dict.Config) (dict.Dict, error)
- type Dict
- func (d *Dict) Begin(ctx context.Context, set *dict.OpSettings) (dict.Tx, error)
- func (d *Dict) Close() error
- func (d *Dict) ExpireScan(ctx context.Context) error
- func (d *Dict) Iterate(ctx context.Context, _ *dict.OpSettings, path string, flags dict.IterFlag) (dict.Iterator, error)
- func (d *Dict) Lookup(ctx context.Context, _ *dict.OpSettings, key string) ([][]byte, bool, error)
- func (d *Dict) Name() string
- func (d *Dict) Wait(_ context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.