reader

package
v0.0.0-...-3e23f1e Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decompress

func Decompress(t string, r io.Reader) (io.Reader, error)

Decompress takes a compression type and a reader and returns reader that will be decompressed if the type is supported.

func DetectType

func DetectType(url string) (string, string)

DetectType attempts to detect the file format and compression types by looking at the file path extensions.

Types

type Reader

type Reader struct {
	Name        string
	Compression string
	// contains filtered or unexported fields
}

Reader encapsulates a stdin stream.

func Open

func Open(name, compr string) (*Reader, error)

Open a reader by name with optional compression. If no name is specified, STDIN is used.

func (*Reader) Close

func (r *Reader) Close()

Close implements the io.Closer interface.

func (*Reader) Read

func (r *Reader) Read(buf []byte) (int, error)

Read implements the io.Reader interface.

type UniversalReader

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

UniversalReader wraps an io.Reader to replace carriage returns with newlines. This is used with the csv.Reader so it can properly delimit lines.

func NewUniversalReader

func NewUniversalReader(r io.Reader) *UniversalReader

func (*UniversalReader) Close

func (r *UniversalReader) Close() error

func (*UniversalReader) Read

func (r *UniversalReader) Read(buf []byte) (int, error)

Jump to

Keyboard shortcuts

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