writer

package
v0.0.0-...-d8b213e Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 4 Imported by: 0

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
}

func NewWriter

func NewWriter(w io.Writer) *Writer

NewWriter creates a new JSON writer.

func (*Writer) Flush

func (w *Writer) Flush() error

Flush writes all data in the buffer to the writer.

func (*Writer) WriteBool

func (w *Writer) WriteBool(v bool) error

WriteBool writes a boolean.

func (*Writer) WriteByte

func (w *Writer) WriteByte(c byte) error

WriteByte writes a single byte.

func (*Writer) WriteFloat32

func (w *Writer) WriteFloat32(v float32) error

WriteFloat32 encodes and writes a 32-bit float.

func (*Writer) WriteFloat64

func (w *Writer) WriteFloat64(v float64) error

WriteFloat64 encodes and writes a 64-bit float.

func (*Writer) WriteInt

func (w *Writer) WriteInt(v int) error

WriteInt encodes and writes an integer.

func (*Writer) WriteInt64

func (w *Writer) WriteInt64(v int64) error

WriteInt64 encodes and writes a 64-bit integer.

func (*Writer) WriteMap

func (w *Writer) WriteMap(v map[string]interface{}) error

WriteMap writes a map.

func (*Writer) WriteNull

func (w *Writer) WriteNull() error

WriteNull writes "null".

func (*Writer) WriteString

func (w *Writer) WriteString(v string) error

WriteString writes a JSON string to the writer. Parts of this function are borrowed from the encoding/json package.

func (*Writer) WriteUint

func (w *Writer) WriteUint(v uint) error

WriteUint encodes and writes an unsigned integer.

func (*Writer) WriteUint64

func (w *Writer) WriteUint64(v uint64) error

WriteUint encodes and writes an unsigned integer.

Jump to

Keyboard shortcuts

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