meta

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2020 License: GPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

DB represents local metabase of storage node.

func NewDB

func NewDB(opts ...Option) *DB

NewDB creates, initializes and returns DB instance.

func (*DB) Close

func (db *DB) Close() error

func (*DB) Delete

func (db *DB) Delete(addr *object.Address) error

Delete marks object as deleted.

func (*DB) DeleteObjects

func (db *DB) DeleteObjects(list ...*object.Address)

DeleteObjects marks list of objects as deleted.

func (*DB) Get

func (db *DB) Get(addr *objectSDK.Address) (*object.Object, error)

Get returns object header for specified address.

func (*DB) Path

func (db *DB) Path() string

Path returns the path to meta database.

func (*DB) Put

func (db *DB) Put(obj *object.Object) error

Put saves object in DB.

Object payload expected to be cut.

func (*DB) Select

func (db *DB) Select(fs object.SearchFilters) (res []*object.Address, err error)

Select returns list of addresses of objects that match search filters.

type Option

type Option func(*cfg)

Option is an option of DB constructor.

func FromBoltDB

func FromBoltDB(db *bbolt.DB) Option

FromBoltDB returns option to construct DB from BoltDB instance.

func WithLogger

func WithLogger(l *logger.Logger) Option

WithLogger returns option to set logger of DB.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL