file

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEF_PATH_CID_INFO = "/.info"
)

cids

Variables

This section is empty.

Functions

This section is empty.

Types

type Cachestore

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

func NewCacheStore

func NewCacheStore(ttl time.Duration) *Cachestore

func (*Cachestore) Batch

func (ds *Cachestore) Batch(ctx context.Context) (datastore.Batch, error)

func (*Cachestore) Close

func (ds *Cachestore) Close() error

func (*Cachestore) Delete

func (ds *Cachestore) Delete(ctx context.Context, key datastore.Key) (err error)

func (*Cachestore) Get

func (ds *Cachestore) Get(ctx context.Context, key datastore.Key) (value []byte, err error)

func (*Cachestore) GetSize

func (ds *Cachestore) GetSize(ctx context.Context, key datastore.Key) (size int, err error)

func (*Cachestore) Has

func (ds *Cachestore) Has(ctx context.Context, key datastore.Key) (exists bool, err error)

func (*Cachestore) Put

func (ds *Cachestore) Put(ctx context.Context, key datastore.Key, value []byte) error

func (*Cachestore) Query

func (ds *Cachestore) Query(ctx context.Context, q query.Query) (query.Results, error)

func (*Cachestore) Sync

func (ds *Cachestore) Sync(ctx context.Context, prefix datastore.Key) error

type FileInfo

type FileInfo struct {
	Path   string
	Ci     cid.Cid
	Offset int
	Size   int
}

func NewFileInfo

func NewFileInfo(ci cid.Cid, path string, offset, size int) *FileInfo

type FileManager

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

file manager by paths or cids

func NewFileManager

func NewFileManager() *FileManager

func (*FileManager) AllKeysChan

func (f *FileManager) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)

func (*FileManager) Get

func (fm *FileManager) Get(cid cid.Cid) *FileInfo

func (*FileManager) Has

func (f *FileManager) Has(ctx context.Context, ci cid.Cid) bool

func (*FileManager) Put

func (fm *FileManager) Put(ci cid.Cid, path string, offset, size int)

func (*FileManager) PutNode

func (fm *FileManager) PutNode(nd format.Node, path string, blockSize int)

type FileStore

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

func NewFileStore

func NewFileStore(rootPath string) *FileStore

func (*FileStore) Delete

func (f *FileStore) Delete(ctx context.Context, path string) error

func (*FileStore) Get

func (f *FileStore) Get(ctx context.Context, path string) (*Reader, error)

func (*FileStore) Iterate

func (f *FileStore) Iterate(path string, fn func(fpath string, reader *Reader) error) error

func (*FileStore) Overwrite

func (f *FileStore) Overwrite(ctx context.Context, path string, writer *Writer) error

func (*FileStore) Put

func (f *FileStore) Put(ctx context.Context, path string, writer *Writer) error

type Reader

type Reader struct {
	*files.ReaderFile
}

func NewReader

func NewReader(reader *files.ReaderFile) *Reader

func NewReaderFromPath

func NewReaderFromPath(path string) *Reader

func (*Reader) GetBlock

func (r *Reader) GetBlock(offset, size int) ([]byte, error)

type Writer

type Writer struct {
	files.Node
}

func NewWriter

func NewWriter(node files.Node) *Writer

func NewWriterFromBytes

func NewWriterFromBytes(bt []byte) *Writer

Jump to

Keyboard shortcuts

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