netstore

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package netstore provides an abstraction layer over the File local storage layer that leverages connectivity with other peers in order to retrieve chunks from the network that cannot be found locally.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRecoveryAttempt = errors.New("failed to retrieve chunk, recovery initiated")
)

Functions

This section is empty.

Types

type Store

type Store struct {
	storage.Storer
	// contains filtered or unexported fields
}

func New

New returns a new NetStore that wraps a given Storer.

func (*Store) Get

func (s *Store) Get(ctx context.Context, mode storage.ModeGet, addr boson.Address, index int64) (ch boson.Chunk, err error)

Get retrieves a given chunk address. It will request a chunk from the network whenever it cannot be found locally.

func (*Store) SetChunkInfo

func (s *Store) SetChunkInfo(chunkInfo chunkinfo.Interface)

Jump to

Keyboard shortcuts

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