iterjson

package module
v0.0.0-...-5418d99 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MIT Imports: 9 Imported by: 0

README

iterjson

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(data []byte, prefix, indent string) []byte

func Fprint

func Fprint(f io.Writer, data any) error

func IterFprint

func IterFprint(f io.Writer, data any) (err error)

func IterPrint

func IterPrint(data any) error

func Marshal

func Marshal(arg any) ([]byte, error)

func MarshalIndent

func MarshalIndent(arg any, prefix, indent string) (data []byte, err error)

func Print

func Print(data any) error

func Println

func Println(data any) error

Types

type Encoder

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

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

func (*Encoder) Encode

func (e *Encoder) Encode(arg any) error

func (*Encoder) SetEscapeHTML

func (e *Encoder) SetEscapeHTML(escapeHTML bool)

func (*Encoder) SetIndent

func (e *Encoder) SetIndent(prefix, indent string)

func (*Encoder) SetNewlines

func (e *Encoder) SetNewlines(newlines bool)

type FormatReader

type FormatReader struct {
	io.Reader
	*Formatter
}

func NewFormatReader

func NewFormatReader(reader io.Reader, prefix, indent string) (f *FormatReader)

func (*FormatReader) Read

func (f *FormatReader) Read(data []byte) (n int, err error)

type FormatWriter

type FormatWriter struct {
	io.Writer
	*Formatter
}

func NewFormatWriter

func NewFormatWriter(dst io.Writer, prefix, indent string) (w *FormatWriter)

func (*FormatWriter) Write

func (w *FormatWriter) Write(p []byte) (int, error)

func (*FormatWriter) WriteByte

func (w *FormatWriter) WriteByte(b byte) error

type Formatter

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

func NewFormatter

func NewFormatter(prefix, indent string) *Formatter

func (*Formatter) Format

func (f *Formatter) Format(p []byte) []byte

func (*Formatter) Read

func (f *Formatter) Read(data []byte) (int, error)

func (*Formatter) Write

func (f *Formatter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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