json

package
v0.15.7 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2020 License: Apache-2.0 Imports: 6 Imported by: 8

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