io

package
v9.1.81+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStream

func NewStream(fn string) (io.WriteCloser, error)

NewStream returns a new output stream. If the filename extension ends with .gz, it will return a gzip output stream

Types

type JSONStream

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

JSONStream is a convenience class for streaming json objects to a file (one JSON per line)

func NewJSONStream

func NewJSONStream(fn string) (*JSONStream, error)

NewJSONStream will return a JSON stream encoder

func (*JSONStream) Close

func (s *JSONStream) Close() error

Close will close the stream

func (*JSONStream) Name

func (s *JSONStream) Name() string

Name returns the underlying filename for the stream

func (*JSONStream) Write

func (s *JSONStream) Write(obj interface{}) error

Write will stream a JSON line to the output stream

Jump to

Keyboard shortcuts

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