mio

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2019 License: AGPL-3.0 Imports: 6 Imported by: 3

Documentation

Overview

Package mio (short for memory input/output) implements the layered io stack of brig. This includes currently three major parts:

- encrypt - Encryption and Decryption layer with seeking support. - compress - Seekable Compression and Decompression with exchangable algorithms. - overlay - In-Memory write overlay over a io.Reader with seek support.

This package itself contains utils that stack those on top of each of other in an already usable fashion.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInStream

func NewInStream(r io.Reader, key []byte, algo compress.AlgorithmType) (io.Reader, error)

NewInStream creates a new stream that pipes data into ipfs. The data is read from `r`, encrypted with `key` and compressed with `algo`.

Types

type Stream

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

Stream is a stream coming from the backend.

func LimitStream

func LimitStream(stream Stream, size uint64) Stream

LimitStream is like io.LimitReader, but works for mio.Stream. It will not allow reading/seeking after the specified size.

func NewOutStream

func NewOutStream(r io.ReadSeeker, key []byte) (Stream, error)

NewOutStream creates an OutStream piping data from brig to the outside. `key` is used to decrypt the data. The compression algorithm is read from the stream header.

Directories

Path Synopsis
Package encrypt implements the encryption layer of brig.
Package encrypt implements the encryption layer of brig.

Jump to

Keyboard shortcuts

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