compfile

package
v0.0.0-...-396f3a7 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package compfile returns ReadClosers for files that are possibly compressed, guessing the compression type based on the file extension.

Index

Constants

View Source
const DefaultBufferSize = 65536

Variables

View Source
var CompressionType = map[string]IoWrapper{
	".bz2":   bzipWrapper,
	".bzip2": bzipWrapper,
	".gz":    gzipWrapper,
}

Functions

func Open

func Open(file string) (io.ReadCloser, error)

Open opens a file (possibly compressed) and returns a suitable buffered ReadCloser.

func OpenBufferedSize

func OpenBufferedSize(file string, size int) (io.ReadCloser, error)

OpenBufferedSize opens a file for buffered I/O with the given buffer size.

Types

type IoWrapper

type IoWrapper func(io.ReadCloser) (io.ReadCloser, error)

Jump to

Keyboard shortcuts

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