common

package
v0.44.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSpace = logicerr.New("no free space")

ErrNoSpace MUST be returned when there is no space to put an object on the device.

View Source
var ErrReadOnly = logicerr.New("opened as read-only")

ErrReadOnly MUST be returned for modifying operations when the storage was opened in readonly mode.

Functions

func Copy added in v0.38.0

func Copy(dst, src Storage) error

Copy copies all objects from source Storage into the destination one. If any object cannot be stored, Copy immediately fails.

Types

type Storage

type Storage interface {
	Open(readOnly bool) error
	Init() error
	Close() error

	Type() string
	Path() string
	SetLogger(*zap.Logger)
	SetCompressor(cc *compression.Config)

	// GetBytes reads object by address into memory buffer in a canonical NeoFS
	// binary format. Returns [apistatus.ObjectNotFound] if object is missing.
	GetBytes(oid.Address) ([]byte, error)
	Get(oid.Address) (*objectSDK.Object, error)
	GetRange(oid.Address, uint64, uint64) ([]byte, error)
	Exists(oid.Address) (bool, error)
	Put(oid.Address, []byte) error
	Delete(oid.Address) error
	Iterate(func(oid.Address, []byte, []byte) error, func(oid.Address, error) error) error
	IterateAddresses(func(oid.Address) error, bool) error
}

Storage represents key-value object storage. It is used as a building block for a blobstor of a shard.

Jump to

Keyboard shortcuts

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