encoding

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeNull   = Type(1)
	TypeNumber = Type(2)
	TypeString = Type(3)
	TypeFalse  = Type(4)
	TypeTrue   = Type(5)
	TypeArray  = Type(6)
	TypeObject = Type(7)
)
View Source
const EOS = byte(0)

Variables

This section is empty.

Functions

func AppendAnyValue

func AppendAnyValue(b []byte, v any) []byte

func AppendFloat64

func AppendFloat64(b []byte, f float64) []byte

AppendFloat64 encodes float64 as bytes that will be correctly comparable with byte.Compare

func AppendInvertedJSON

func AppendInvertedJSON(b []byte, v *fastjson.Value) []byte

func AppendJSONValue

func AppendJSONValue(b []byte, v *fastjson.Value) []byte

func AppendNumber

func AppendNumber[T constraints.Integer | constraints.Float](b []byte, n T) []byte

func BytesToFloat64

func BytesToFloat64(b []byte) float64

BytesToFloat64 decodes float64 from bytes encoded with AppendFloat64

func DecodeToAny

func DecodeToAny(b []byte) (v any, n int, err error)

func DecodeToByte

func DecodeToByte(b []byte) (v []byte, n int, err error)

func DecodeToJSON

func DecodeToJSON(p *fastjson.Parser, a *fastjson.Arena, b []byte) (v *fastjson.Value, n int, err error)

Types

type Type

type Type uint8

func FastJSONTypeToType

func FastJSONTypeToType(t fastjson.Type) Type

Jump to

Keyboard shortcuts

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