{"modulePath":"github.com/ethersphere/bee","version":"v1.16.1","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package pullstorage\n\n## Variables\n\n```go\nvar (\n\n\t// ErrDbClosed is used to signal the underlying database was closed\n\tErrDbClosed = errors.New(\"db closed\")\n)\n```\n\n## Types\n\n```go\ntype PullStorer struct {\n\tstorage.Storer\n\t// contains filtered or unexported fields\n}\n```\nPullStorer wraps storage.Storer.\n\n```go\nfunc New(storer storage.Storer, logger log.Logger) *PullStorer\n```\nNew returns a new pullstorage Storer instance.\n\n```go\nfunc (s *PullStorer) Cursors(ctx context.Context) (curs []uint64, err error)\n```\nCursors gets the last BinID for every bin in the local storage\n\n```go\nfunc (s *PullStorer) Get(ctx context.Context, mode storage.ModeGet, addrs ...swarm.Address) ([]swarm.Chunk, error)\n```\nGet chunks.\n\n```go\nfunc (s *PullStorer) Has(ctx context.Context, addr swarm.Address) (bool, error)\n```\nPut chunks.\n\n```go\nfunc (s *PullStorer) IntervalChunks(ctx context.Context, bin uint8, from, to uint64, limit int) ([]swarm.Address, uint64, error)\n```\nIntervalChunks collects chunk for a requested interval.\n\n```go\nfunc (s *PullStorer) Metrics() []prometheus.Collector\n```\n\n```go\nfunc (s *PullStorer) Put(ctx context.Context, mode storage.ModePut, chs ...swarm.Chunk) error\n```\nPut chunks.\n\n```go\ntype Storer interface {\n\t// IntervalChunks collects chunk for a requested interval.\n\tIntervalChunks(ctx context.Context, bin uint8, from, to uint64, limit int) (chunks []swarm.Address, topmost uint64, err error)\n\t// Cursors gets the last BinID for every bin in the local storage\n\tCursors(ctx context.Context) ([]uint64, error)\n\t// Get chunks.\n\tGet(ctx context.Context, mode storage.ModeGet, addrs ...swarm.Address) ([]swarm.Chunk, error)\n\t// Put chunks.\n\tPut(ctx context.Context, mode storage.ModePut, chs ...swarm.Chunk) error\n\t// Set chunks.\n\tSet(ctx context.Context, mode storage.ModeSet, addrs ...swarm.Address) error\n\t// Has chunks.\n\tHas(ctx context.Context, addr swarm.Address) (bool, error)\n}\n```\nStorer is a thin wrapper around storage.Storer. It is used in order to collect and provide information about chunks currently present in the local store.\n\n","path":"github.com/ethersphere/bee/pkg/pullsync/pullstorage","name":"pullstorage","synopsis":"","isRedistributable":true}
