models

package
v0.46.14 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcurrencyLimiter

type ConcurrencyLimiter interface {
	AcquireWorkSlot(ctx context.Context) (ReleaseFunc, error)
}

type DeletePrm

type DeletePrm struct {
	Address   oid.Address
	StorageID []byte
	Size      uint64
}

DeletePrm groups the parameters of Delete operation.

type DeleteRes

type DeleteRes struct{}

DeleteRes groups the resulting values of Delete operation.

type ExistsPrm

type ExistsPrm struct {
	Address   oid.Address
	StorageID []byte
}

ExistsPrm groups the parameters of Exists operation.

type ExistsRes

type ExistsRes struct {
	Exists bool
}

ExistsRes groups the resulting values of Exists operation.

type GetPrm

type GetPrm struct {
	Address   oid.Address
	StorageID []byte
	Raw       bool
}

type GetRangePrm

type GetRangePrm struct {
	Address   oid.Address
	Range     objectSDK.Range
	StorageID []byte
}

type GetRangeRes

type GetRangeRes struct {
	Data []byte
}

type GetRes

type GetRes struct {
	Object  *objectSDK.Object
	RawData []byte
}

type IteratePrm

type IteratePrm struct {
	Handler      IterationHandler
	IgnoreErrors bool
}

IteratePrm groups the parameters of Iterate operation.

type IterateRes

type IterateRes struct{}

IterateRes groups the resulting values of Iterate operation.

type IterationElement

type IterationElement struct {
	ObjectData []byte
	Address    oid.Address
	StorageID  []byte
}

IterationElement represents a unit of elements through which Iterate operation passes.

type IterationHandler

type IterationHandler func(IterationElement) error

IterationHandler is a generic processor of IterationElement.

type MetaStorage

type MetaStorage interface {
	UpdateStorageID(ctx context.Context, addr oid.Address, storageID []byte) error
}

type PutPrm

type PutPrm struct {
	Address oid.Address
	Object  *objectSDK.Object
	RawData []byte
}

PutPrm groups the parameters of Put operation.

type PutRes

type PutRes struct {
	StorageID []byte
}

PutRes groups the resulting values of Put operation.

type RateLimiter

type RateLimiter interface {
	ReadRequest(context.Context) (ReleaseFunc, error)
	WriteRequest(context.Context) (ReleaseFunc, error)
}

type RebuildLimiter

type RebuildLimiter interface {
	ConcurrencyLimiter
	RateLimiter
}

type RebuildPrm

type RebuildPrm struct {
	MetaStorage MetaStorage
	Limiter     RebuildLimiter
	FillPercent int
}

type RebuildRes

type RebuildRes struct {
	ObjectsMoved uint64
	FilesRemoved uint64
}

type ReleaseFunc

type ReleaseFunc func()

type Storage

type Storage interface {
	Open(mode mode.ComponentMode) error
	Init() error
	Close(context.Context) error

	Type() string
	Path() string
	ObjectsCount(ctx context.Context) (uint64, error)

	SetCompressor(cc *compression.Compressor)
	Compressor() *compression.Compressor

	// SetReportErrorFunc allows to provide a function to be called on disk errors.
	// This function MUST be called before Open.
	SetReportErrorFunc(f func(context.Context, string, error))
	SetParentID(parentID string)

	Get(context.Context, GetPrm) (GetRes, error)
	GetRange(context.Context, GetRangePrm) (GetRangeRes, error)
	Exists(context.Context, ExistsPrm) (ExistsRes, error)
	Put(context.Context, PutPrm) (PutRes, error)
	Delete(context.Context, DeletePrm) (DeleteRes, error)
	Iterate(context.Context, IteratePrm) (IterateRes, error)
	Rebuild(context.Context, RebuildPrm) (RebuildRes, 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