jsontext

package
v0.59.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package jsontext provides a fast JSON encoder providing only the necessary features for qlog encoding. No efforts are made to add any features beyond qlog's requirements.

The API aims to be compatible with the standard library's encoding/json/jsontext package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

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

Encoder encodes JSON to an io.Writer.

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

NewEncoder creates a new Encoder.

func (*Encoder) WriteToken

func (e *Encoder) WriteToken(t Token) error

WriteToken writes a token to the encoder.

type Token

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

Token represents a JSON token.

var BeginArray Token = Token{/* contains filtered or unexported fields */}

BeginArray is the begin array token.

var BeginObject Token = Token{/* contains filtered or unexported fields */}

BeginObject is the begin object token.

var EndArray Token = Token{/* contains filtered or unexported fields */}

EndArray is the end array token.

var EndObject Token = Token{/* contains filtered or unexported fields */}

EndObject is the end object token.

var False Token = Bool(false)

False is a false token.

var Null Token = Token{/* contains filtered or unexported fields */}

Null is a null token.

var True Token = Bool(true)

True is a true token.

func Bool

func Bool(b bool) Token

Bool creates a bool token.

func Float

func Float(f float64) Token

Float creates a float token.

func Int

func Int(i int64) Token

Int creates an int token.

func String

func String(s string) Token

String creates a string token.

func Uint

func Uint(u uint64) Token

Uint creates a uint token.

Jump to

Keyboard shortcuts

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