jsontext

package
v1.0.10-utls Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 4 Imported by: 0

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

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

BeginArray is the begin array token.

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

BeginObject is the begin object token.

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

EndArray is the end array token.

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

EndObject is the end object token.

View Source
var False = Bool(false)

False is a false token.

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

Null is a null token.

View Source
var True = Bool(true)

True is a true token.

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.

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