json

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: May 29, 2019 License: Apache-2.0 Imports: 6 Imported by: 0 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Writer

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

A Writer can be used to directly stream JSON results without going through an intermediate object layer.

func NewWriter

func NewWriter(w io.Writer) *Writer

NewWriter creates a new JSON token writer

func (*Writer) BeginArray

func (w *Writer) BeginArray()

BeginArray begins a new array value

func (*Writer) BeginObject

func (w *Writer) BeginObject()

BeginObject begins a new object

func (*Writer) BeginObjectField

func (w *Writer) BeginObjectField(name string)

BeginObjectField begins a new object field with the given name

func (*Writer) Close

func (w *Writer) Close() error

Close closes the writer, returning any write errors that have occurred

func (*Writer) EndArray

func (w *Writer) EndArray()

EndArray finishes an array value

func (*Writer) EndObject

func (w *Writer) EndObject()

EndObject finishes an open object

func (*Writer) Flush

func (w *Writer) Flush() error

Flush flushes the writer

func (*Writer) WriteBool

func (w *Writer) WriteBool(b bool)

WriteBool writes a boolean value

func (*Writer) WriteFloat64

func (w *Writer) WriteFloat64(n float64)

WriteFloat64 writes a float value

func (*Writer) WriteInt

func (w *Writer) WriteInt(n int)

WriteInt writes an int value

func (*Writer) WriteNull

func (w *Writer) WriteNull()

WriteNull writes a null value

func (*Writer) WriteString

func (w *Writer) WriteString(s string)

WriteString writes a string value

Jump to

Keyboard shortcuts

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