satstore

package
v1.119.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SatelliteStore

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

SatelliteStore is a helper that allows atomically writing satellite scoped files into a directory.

func NewSatelliteStore

func NewSatelliteStore(dir, ext string) *SatelliteStore

NewSatelliteStore returns a SatelliteStore rooted at the given directory and will append the files with the given extension. The files will be named like `<dir>/<satellite id>.<ext>`.

func (*SatelliteStore) Get

func (s *SatelliteStore) Get(ctx context.Context, satellite storj.NodeID) (_ []byte, err error)

Get returns the data for the given satellite returning any errors. There will be an error if the satellite does not exist.

func (*SatelliteStore) Range

func (s *SatelliteStore) Range(cb func(storj.NodeID, []byte) error) (err error)

Range calls the callback for every satellite, recording any errors returned by either the callback or the iteration process into the returned error value.

func (*SatelliteStore) Set

func (s *SatelliteStore) Set(ctx context.Context, satellite storj.NodeID, data []byte) (err error)

Set atomically writes the data for the given satellite.

Jump to

Keyboard shortcuts

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