writer

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2019 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package iterator provides an easy API to create an iterator to read objects from a file. Depends on the following packages in go-simple-serializer.

  • github.com/spatialcurrent/go-simple-serializer/pkg/jsonl
  • github.com/spatialcurrent/go-simple-serializer/pkg/sv
  • github.com/spatialcurrent/go-simple-serializer/pkg/tags

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingKeyValueSeparator = errors.New("missing key-value separator")
	ErrMissingLineSeparator     = errors.New("missing line separator")
)

Functions

func NewWriter

func NewWriter(input *NewWriterInput) (pipe.Writer, error)

NewWriter returns a new pipe.Writer for writing formatted objects to an underlying writer.

Types

type ErrInvalidFormat

type ErrInvalidFormat struct {
	Format string // the name of the invalid format
}

ErrInvalidFormat is used when an invalid format is provided.

func (ErrInvalidFormat) Error

func (e ErrInvalidFormat) Error() string

Error returns the error as a string.

type NewWriterInput

type NewWriterInput struct {
	Writer            io.Writer
	Format            string
	FormatSpecifier   string
	Header            []interface{}
	ExpandHeader      bool // in context, only used by tags as ExpandKeys
	KeySerializer     stringify.Stringer
	ValueSerializer   stringify.Stringer
	KeyValueSeparator string
	LineSeparator     string
	Fit               bool
	Pretty            bool
	Sorted            bool
	Reversed          bool
}

Parameters for NewWriter function.

Jump to

Keyboard shortcuts

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