Documentation ¶
Index ¶
- type BlobStor
- func (b *BlobStor) Close() error
- func (b *BlobStor) DeleteBig(prm *DeleteBigPrm) (*DeleteBigRes, error)
- func (b *BlobStor) DeleteSmall(prm *DeleteSmallPrm) (*DeleteSmallRes, error)
- func (b *BlobStor) DumpInfo() fstree.Info
- func (b *BlobStor) Exists(prm *ExistsPrm) (*ExistsRes, error)
- func (b *BlobStor) GetBig(prm *GetBigPrm) (*GetBigRes, error)
- func (b *BlobStor) GetRangeBig(prm *GetRangeBigPrm) (*GetRangeBigRes, error)
- func (b *BlobStor) GetRangeSmall(prm *GetRangeSmallPrm) (*GetRangeSmallRes, error)
- func (b *BlobStor) GetSmall(prm *GetSmallPrm) (*GetSmallRes, error)
- func (b *BlobStor) Init() error
- func (b *BlobStor) Iterate(prm *IteratePrm) (*IterateRes, error)
- func (b *BlobStor) Open() error
- func (b *BlobStor) Put(prm *PutPrm) (*PutRes, error)
- func (b *BlobStor) PutRaw(addr *objectSDK.Address, data []byte) (*PutRes, error)
- type DeleteBigPrm
- type DeleteBigRes
- type DeleteSmallPrm
- type DeleteSmallRes
- type ExistsPrm
- type ExistsRes
- type GetBigPrm
- type GetBigRes
- type GetRangeBigPrm
- type GetRangeBigRes
- type GetRangeSmallPrm
- type GetRangeSmallRes
- type GetSmallPrm
- type GetSmallRes
- type Info
- type IteratePrm
- type IterateRes
- type IterationHandler
- type Option
- func WithBlobovniczaOpenedCacheSize(sz int) Option
- func WithBlobovniczaShallowDepth(d uint64) Option
- func WithBlobovniczaShallowWidth(w uint64) Option
- func WithBlobovniczaSize(sz uint64) Option
- func WithCompressObjects(comp bool, log *logger.Logger) Option
- func WithLogger(l *logger.Logger) Option
- func WithRootPath(rootDir string) Option
- func WithRootPerm(perm fs.FileMode) Option
- func WithShallowDepth(depth int) Option
- func WithSmallSizeLimit(lim uint64) Option
- type PutPrm
- type PutRes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlobStor ¶
type BlobStor struct {
// contains filtered or unexported fields
}
BlobStor represents NeoFS local BLOB storage.
func (*BlobStor) DeleteBig ¶
func (b *BlobStor) DeleteBig(prm *DeleteBigPrm) (*DeleteBigRes, error)
DeleteBig removes object from shallow dir of BLOB storage.
Returns any error encountered that did not allow to completely remove the object.
Returns ErrNotFound if there is no object to delete.
func (*BlobStor) DeleteSmall ¶
func (b *BlobStor) DeleteSmall(prm *DeleteSmallPrm) (*DeleteSmallRes, error)
DeleteSmall removes object from blobovnicza of BLOB storage.
If blobovnicza ID is not set or set to nil, BlobStor tries to find and remove object from any blobovnicza.
Returns any error encountered that did not allow to completely remove the object.
Returns ErrObjectNotFound if there is no object to delete.
func (*BlobStor) Exists ¶
Exists checks if object is presented in BLOB storage.
Returns any error encountered that did not allow to completely check object existence.
func (*BlobStor) GetBig ¶
GetBig reads the object from shallow dir of BLOB storage by address.
Returns any error encountered that did not allow to completely read the object.
Returns ErrNotFound if requested object is not presented in shallow dir.
func (*BlobStor) GetRangeBig ¶
func (b *BlobStor) GetRangeBig(prm *GetRangeBigPrm) (*GetRangeBigRes, error)
GetRangeBig reads data of object payload range from shallow dir of BLOB storage.
Returns any error encountered that did not allow to completely read the object payload range.
Returns ErrRangeOutOfBounds if requested object range is out of bounds.
func (*BlobStor) GetRangeSmall ¶
func (b *BlobStor) GetRangeSmall(prm *GetRangeSmallPrm) (*GetRangeSmallRes, error)
GetRangeSmall reads data of object payload range from blobovnicza of BLOB storage.
If blobovnicza ID is not set or set to nil, BlobStor tries to get payload range from any blobovnicza.
Returns any error encountered that did not allow to completely read the object payload range.
Returns ErrRangeOutOfBounds if requested object range is out of bounds.
func (*BlobStor) GetSmall ¶
func (b *BlobStor) GetSmall(prm *GetSmallPrm) (*GetSmallRes, error)
GetSmall reads the object from blobovnicza of BLOB storage by address.
If blobovnicza ID is not set or set to nil, BlobStor tries to get object from any blobovnicza.
Returns any error encountered that did not allow to completely read the object.
func (*BlobStor) Init ¶
Init initializes internal data structures and system resources.
If BlobStor is already initialized, then no action is taken.
func (*BlobStor) Iterate ¶
func (b *BlobStor) Iterate(prm *IteratePrm) (*IterateRes, error)
Iterate traverses the storage over the stored objects and calls the handler on each element.
Returns any error encountered that did not allow to completely iterate over the storage.
If handler returns an error, method returns it immediately.
func (*BlobStor) Put ¶
Put saves the object in BLOB storage.
If object is "big", BlobStor saves the object in shallow dir. Otherwise, BlobStor saves the object in blobonicza. In this case the identifier of blobovnicza is returned.
Returns any error encountered that did not allow to completely save the object.
type DeleteBigPrm ¶
type DeleteBigPrm struct {
// contains filtered or unexported fields
}
DeleteBigPrm groups the parameters of DeleteBig operation.
func (*DeleteBigPrm) SetAddress ¶
SetAddress sets the address of the requested object.
type DeleteBigRes ¶
type DeleteBigRes struct{}
DeleteBigRes groups resulting values of DeleteBig operation.
type DeleteSmallPrm ¶
type DeleteSmallPrm struct {
// contains filtered or unexported fields
}
DeleteSmallPrm groups the parameters of DeleteSmall operation.
func (*DeleteSmallPrm) SetAddress ¶
SetAddress sets the address of the requested object.
func (*DeleteSmallPrm) SetBlobovniczaID ¶
func (v *DeleteSmallPrm) SetBlobovniczaID(id *blobovnicza.ID)
SetBlobovniczaID sets blobovnicza ID.
type DeleteSmallRes ¶
type DeleteSmallRes struct{}
DeleteSmallRes groups resulting values of DeleteSmall operation.
type ExistsPrm ¶
type ExistsPrm struct {
// contains filtered or unexported fields
}
ExistsPrm groups the parameters of Exists operation.
func (*ExistsPrm) SetAddress ¶
SetAddress sets the address of the requested object.
type ExistsRes ¶
type ExistsRes struct {
// contains filtered or unexported fields
}
ExistsRes groups resulting values of Exists operation.
type GetBigPrm ¶
type GetBigPrm struct {
// contains filtered or unexported fields
}
GetBigPrm groups the parameters of GetBig operation.
func (*GetBigPrm) SetAddress ¶
SetAddress sets the address of the requested object.
type GetBigRes ¶
type GetBigRes struct {
// contains filtered or unexported fields
}
GetBigRes groups resulting values of GetBig operation.
type GetRangeBigPrm ¶
type GetRangeBigPrm struct {
// contains filtered or unexported fields
}
GetRangeBigPrm groups the parameters of GetRangeBig operation.
func (*GetRangeBigPrm) SetAddress ¶
SetAddress sets the address of the requested object.
type GetRangeBigRes ¶
type GetRangeBigRes struct {
// contains filtered or unexported fields
}
GetRangeBigRes groups resulting values of GetRangeBig operation.
type GetRangeSmallPrm ¶
type GetRangeSmallPrm struct {
// contains filtered or unexported fields
}
GetRangeSmallPrm groups the parameters of GetRangeSmall operation.
func (*GetRangeSmallPrm) SetAddress ¶
SetAddress sets the address of the requested object.
func (*GetRangeSmallPrm) SetBlobovniczaID ¶
func (v *GetRangeSmallPrm) SetBlobovniczaID(id *blobovnicza.ID)
SetBlobovniczaID sets blobovnicza ID.
type GetRangeSmallRes ¶
type GetRangeSmallRes struct {
// contains filtered or unexported fields
}
GetRangeSmallRes groups resulting values of GetRangeSmall operation.
type GetSmallPrm ¶
type GetSmallPrm struct {
// contains filtered or unexported fields
}
GetSmallPrm groups the parameters of GetSmallPrm operation.
func (*GetSmallPrm) SetAddress ¶
SetAddress sets the address of the requested object.
func (*GetSmallPrm) SetBlobovniczaID ¶
func (v *GetSmallPrm) SetBlobovniczaID(id *blobovnicza.ID)
SetBlobovniczaID sets blobovnicza ID.
type GetSmallRes ¶
type GetSmallRes struct {
// contains filtered or unexported fields
}
GetSmallRes groups resulting values of GetSmall operation.
type IteratePrm ¶
type IteratePrm struct {
// contains filtered or unexported fields
}
IteratePrm groups the parameters of Iterate operation.
func (*IteratePrm) SetIterationHandler ¶
func (i *IteratePrm) SetIterationHandler(h IterationHandler)
SetIterationHandler sets the action to be performed on each iteration.
type IterationHandler ¶
type IterationHandler func(*objectSDK.Address, *blobovnicza.ID) error
IterationHandler represents the action to be performed on each iteration.
type Option ¶
type Option func(*cfg)
Option represents BlobStor's constructor option.
func WithBlobovniczaOpenedCacheSize ¶
WithBlobovniczaOpenedCacheSize return option to specify maximum number of opened non-active blobovnicza's.
func WithBlobovniczaShallowDepth ¶
WithBlobovniczaShallowDepth returns option to specify depth of blobovnicza directories.
func WithBlobovniczaShallowWidth ¶
WithBlobovniczaShallowWidth returns option to specify width of blobovnicza directories.
func WithBlobovniczaSize ¶
WithBlobovniczaSize returns option to specify maximum volume of each blobovnicza.
func WithCompressObjects ¶
WithCompressObjects returns option to toggle compression of the stored objects.
If true, Zstandard algorithm is used for data compression.
If compressor (decompressor) creation failed, the uncompressed option will be used, and the error is recorded in the provided log.
func WithLogger ¶
WithLogger returns option to specify BlobStor's logger.
func WithRootPath ¶
WithRootPath returns option to set path to root directory of the fs tree to write the objects.
func WithRootPerm ¶
WithRootPerm returns option to set permission bits of the fs tree.
func WithShallowDepth ¶
WithShallowDepth returns option to set the depth of the object file subdirectory tree.
Depth is reduced to maximum value in case of overflow.
func WithSmallSizeLimit ¶
WithSmallSizeLimit returns option to set maximum size of "small" object.
type PutPrm ¶
type PutPrm struct {
// contains filtered or unexported fields
}
PutPrm groups the parameters of Put operation.
type PutRes ¶
type PutRes struct {
// contains filtered or unexported fields
}
PutRes groups resulting values of Put operation.
func (PutRes) BlobovniczaID ¶
func (v PutRes) BlobovniczaID() *blobovnicza.ID
BlobovniczaID returns blobovnicza ID.