cipherfile

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIsDir            = errors.New("this dag node is a directory")
	ErrCantReadSymlinks = errors.New("cannot currently read symlinks")
	ErrUnkownNodeType   = errors.New("unknown node type")
	ErrSeekNotSupported = errors.New("file does not support seeking")
)

Common errors

Functions

func NewCipherFile

func NewCipherFile(ctx context.Context, dserv ipld.DAGService, nd ipld.Node, auth cipher.AEAD) (files.Node, error)

Types

type DagReader

type DagReader interface {
	ReadSeekCloser
	Size() uint64
	CtxReadFull(context.Context, []byte) (int, error)
}

A DagReader provides read-only read and seek acess to a unixfs file. Different implementations of readers are used for the different types of unixfs/protobuf-encoded nodes.

func NewDagReader

func NewDagReader(ctx context.Context, n ipld.Node, serv ipld.NodeGetter, auth cipher.AEAD) (DagReader, error)

NewDagReader creates a new reader object that reads the data represented by the given node, using the passed in DAGService for data retrieval.

type ReadSeekCloser

type ReadSeekCloser interface {
	io.Reader
	io.Seeker
	io.Closer
	io.WriterTo
}

A ReadSeekCloser implements interfaces to read, copy, seek and close.

Jump to

Keyboard shortcuts

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