Documentation ¶
Index ¶
- Constants
- Variables
- type FSTree
- func (t *FSTree) Delete(addr oid.Address) error
- func (t *FSTree) Exists(addr oid.Address) (string, error)
- func (t *FSTree) Get(addr oid.Address) ([]byte, error)
- func (t *FSTree) Iterate(prm IterationPrm) error
- func (t *FSTree) NumberOfObjects() (uint64, error)
- func (t *FSTree) Put(addr oid.Address, data []byte) error
- func (t *FSTree) PutStream(addr oid.Address, handler func(*os.File) error) error
- type Info
- type IterationPrm
Constants ¶
const ( // DirNameLen is how many bytes is used to group keys into directories. DirNameLen = 1 // in bytes // MaxDepth is maximum depth of nested directories. MaxDepth = (sha256.Size - 1) / DirNameLen )
Variables ¶
var ErrFileNotFound = errors.New("file not found")
ErrFileNotFound is returned when file is missing.
Functions ¶
This section is empty.
Types ¶
type FSTree ¶
FSTree represents an object storage as a filesystem tree.
func (*FSTree) Exists ¶
Exists returns the path to the file with object contents if it exists in the storage and an error otherwise.
func (*FSTree) Iterate ¶
func (t *FSTree) Iterate(prm IterationPrm) error
Iterate iterates over all stored objects.
func (*FSTree) NumberOfObjects ¶ added in v0.26.1
NumberOfObjects walks the file tree rooted at FSTree's root and returns number of stored objects.
type Info ¶
type Info struct { // Permission bits of the root directory. Permissions fs.FileMode // Full path to the root directory. RootPath string }
Info groups the information about file storage.
type IterationPrm ¶ added in v0.27.5
type IterationPrm struct {
// contains filtered or unexported fields
}
IterationPrm contains iteraction parameters.
func (*IterationPrm) WithHandler ¶ added in v0.27.5
func (p *IterationPrm) WithHandler(f func(addr oid.Address, data []byte) error)
WithHandler sets a function to call on each object.
func (*IterationPrm) WithIgnoreErrors ¶ added in v0.27.5
func (p *IterationPrm) WithIgnoreErrors(ignore bool)
WithIgnoreErrors sets a flag indicating whether errors should be ignored.
func (*IterationPrm) WithLazyHandler ¶ added in v0.28.2
WithLazyHandler sets a function to call on each object. Second callback parameter opens file and reads all data to a buffer. File is not opened at all unless this callback is invoked.