json

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package json implements the JSON format for Emitter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Appender

type Appender = appenders.Appender

type BytesAppender

type BytesAppender struct {
	Value []byte
}

func (BytesAppender) Append

func (a BytesAppender) Append(out []byte) []byte

func (BytesAppender) String

func (a BytesAppender) String() string

type Format

type Format byte
const (
	Compact Format = iota
	OneLine
	MultiLine
)

func (Format) GoString

func (f Format) GoString() string

func (Format) IsValid

func (f Format) IsValid() bool

func (Format) MarshalText

func (f Format) MarshalText() ([]byte, error)

func (*Format) Parse

func (f *Format) Parse(input string) error

func (Format) String

func (f Format) String() string

func (*Format) UnmarshalText

func (f *Format) UnmarshalText(input []byte) error

type Generator

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

func (*Generator) Begin

func (g *Generator) Begin() []Appender

func (*Generator) BigFloatValue

func (g *Generator) BigFloatValue(value *big.Float) []Appender

func (*Generator) BigIntValue

func (g *Generator) BigIntValue(value *big.Int) []Appender

func (*Generator) BoolValue

func (g *Generator) BoolValue(value bool) []Appender

func (*Generator) ByteValue

func (g *Generator) ByteValue(value byte) []Appender

func (*Generator) BytesValue

func (g *Generator) BytesValue(value []byte) []Appender

func (*Generator) End

func (g *Generator) End() []Appender

func (*Generator) EndArray

func (g *Generator) EndArray() []Appender

func (*Generator) EndObject

func (g *Generator) EndObject() []Appender

func (*Generator) Factory

func (g *Generator) Factory() emitter.GeneratorFactory

func (*Generator) FloatValue

func (g *Generator) FloatValue(value float64) []Appender

func (*Generator) InfValue

func (g *Generator) InfValue(isNeg bool) []Appender

func (*Generator) IntValue

func (g *Generator) IntValue(value int64) []Appender

func (*Generator) Key

func (g *Generator) Key(key string) []Appender

func (*Generator) NaNValue

func (g *Generator) NaNValue() []Appender

func (*Generator) NullValue

func (g *Generator) NullValue() []Appender

func (*Generator) Reset

func (g *Generator) Reset()

func (*Generator) RuneValue

func (g *Generator) RuneValue(value rune) []Appender

func (*Generator) StartArray

func (g *Generator) StartArray() []Appender

func (*Generator) StartObject

func (g *Generator) StartObject() []Appender

func (*Generator) StringValue

func (g *Generator) StringValue(value string) []Appender

func (*Generator) UintValue

func (g *Generator) UintValue(value uint64) []Appender

type JSON

type JSON struct {
	Format         Format
	IndentSize     uint
	IndentWithTabs bool
	EscapeHTML     bool
	TraceEnabled   bool
}

func (JSON) NewGenerator

func (json JSON) NewGenerator() emitter.Generator

type StringAppender

type StringAppender struct {
	Value      string
	EscapeHTML bool
}

func (StringAppender) Append

func (a StringAppender) Append(out []byte) []byte

func (StringAppender) String

func (a StringAppender) String() string

Jump to

Keyboard shortcuts

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