iox

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2020 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(closer io.Closer)

close ignore error

func EmptyReader added in v1.0.1

func EmptyReader() io.Reader

Return a empty reader

func ReadAll

func ReadAll(reader io.Reader) ([]byte, error)

Read and return all data in reader

func ReadAllLines

func ReadAllLines(reader io.Reader) ([]string, error)

ReadAllLines read all data as string lines, till EOF, return a lines slice. The reader will be leaved unclosed

func ReadAllLinesWithEncoding

func ReadAllLinesWithEncoding(reader io.Reader, encoding encoding.Encoding) ([]string, error)

ReadAllLines read all data as string line with specific encoding till EOF, return a lines slice. The reader will be leaved unclosed

func ReadAllToString

func ReadAllToString(reader io.Reader) (string, error)

Read and return all data as string in reader

func ReadAllToStringWithEncoding

func ReadAllToStringWithEncoding(reader io.Reader, encoding encoding.Encoding) (string, error)

Read and return all data as string in reader

func ReadLines

func ReadLines(reader io.Reader, consume func(line string)) error

ReadLines read line by line from reader, and return a error if read failed. The reader will be leaved unclosed

func ReadLinesWithEncoding

func ReadLinesWithEncoding(reader io.Reader, encoding encoding.Encoding, consume func(line string)) error

ReadLines read line by line from reader with specific encoding, and return a error if read failed. The reader will be leaved unclosed

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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