rofs

package
v2.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultDownloadWorkers = 4
	DefaultBlockSize       = 512 //KB
)

Variables

This section is empty.

Functions

func New

func New(cfg *Config) pathfs.FileSystem

New creates a new filesystem object with given configuration

Types

type Config

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

Config represents a filesystem configuration object Configuration objects can be used to manipulate some filesystem flags in runtime

func NewConfig

func NewConfig(storage storage.Storage, store meta.MetaStore, cache string) *Config

NewConfig creates a new filesystem config object with given meta store, and data storage and local cache directory

func (*Config) SetDataStorage

func (c *Config) SetDataStorage(storage storage.Storage)

SetDataStorage sets the filesystem data storage in runtime

func (*Config) SetMetaStore

func (c *Config) SetMetaStore(store meta.MetaStore)

SetMetaStore sets the filesystem meta store in runtime.

type Downloader

type Downloader struct {
	Workers   int
	Storage   storage.Storage
	Blocks    []meta.BlockInfo
	BlockSize uint64
}

func (*Downloader) Download

func (d *Downloader) Download(output *os.File) error

Download download the file into this output file

func (*Downloader) DownloadBlock

func (d *Downloader) DownloadBlock(block meta.BlockInfo) ([]byte, error)

type OutputBlock

type OutputBlock struct {
	Raw   []byte
	Index int
}

Jump to

Keyboard shortcuts

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