Documentation
¶
Index ¶
- func Get(db *badger.DB, key []byte) ([]byte, error)
- func IterateDB(db *badger.DB, f func(oid.Address) error) error
- func New(opts ...Option) writecache.Cache
- func OpenDB(p string, ro bool, l *logger.Logger) (*badger.DB, error)
- type Option
- func WithBlobstor(bs writecache.MainStorage) Option
- func WithFlushWorkersCount(c int) Option
- func WithGCInterval(d time.Duration) Option
- func WithLogger(log *logger.Logger) Option
- func WithMaxCacheSize(sz uint64) Option
- func WithMaxObjectSize(sz uint64) Option
- func WithMetabase(db writecache.Metabase) Option
- func WithMetrics(metrics writecache.Metrics) Option
- func WithPath(path string) Option
- func WithReportErrorFunc(f func(string, error)) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get fetches object from the underlying database. Key should be a stringified address.
Returns an error of type apistatus.ObjectNotFound if the requested object is missing in db.
Types ¶
type Option ¶
type Option func(*options)
Option represents write-cache configuration option.
func WithBlobstor ¶
func WithBlobstor(bs writecache.MainStorage) Option
WithBlobstor sets main object storage.
func WithFlushWorkersCount ¶
func WithGCInterval ¶
WithGCInterval sets the duration of the interval to run GC cycles.
func WithMaxCacheSize ¶
WithMaxCacheSize sets maximum write-cache size in bytes.
func WithMaxObjectSize ¶
WithMaxObjectSize sets maximum object size to be stored in write-cache.
func WithMetrics ¶
func WithMetrics(metrics writecache.Metrics) Option
WithMetrics sets metrics implementation.
func WithReportErrorFunc ¶
WithReportErrorFunc sets error reporting function.
Click to show internal directories.
Click to hide internal directories.