Categorygithub.com/romshark/jscan-experimental-decoder
modulepackage
0.0.0-20240321111022-5ddd6bb1c485
Repository: https://github.com/romshark/jscan-experimental-decoder.git
Documentation: pkg.go.dev

# README

GoReportCard Coverage Status

Experimental JSON decoder based on jscan

⚠️ Don't use in production! ⚠️

This is an experimental JSON Unmarshaler/Decoder implementation for Go based on jscan. This decoder will be moved to jscan v3 once it's ready for production.

The jscan decoder is expected to be a backward compatible drop-in replacement for encoding/json.

Roadmap:

  • Primitive types
  • Struct types
    • Type struct{}
    • Recursive struct types
  • Slices
  • Arrays
  • Type any
  • Type map
    • string keys
    • encoding.TextUnmarshaler keys
    • Integer keys
  • JSON struct tags
    • Case-insensitive key matching (backward-compatibility feature of encoding/json)
    • Option DisallowUnknownFields
    • Option DisableFieldNameUnescaping
    • Option DisableCaseInsensitiveMatching
    • Option DisallowDuplicateNames
    • Struct tag option string
  • Pointers
  • Type Unmarshaler interface { UnmarshalJSON([]byte) error }
  • Type TextUnmarshaler interface { UnmarshalText(text []byte) error }
  • encoding/json compatible drop-in replacement package jscandec/std
    • encoding/json compatible error messages

# Packages

No description provided by the author

# Functions

NewDecoder creates a new reusable decoder instance.
Unmarshal dynamically allocates new decoder and tokenizer instances and unmarshals the JSON contents of s into t.

# Constants

ExpectTypeAny is type `any`.
ExpectTypeArray is any array type except zero-length array.
ExpectTypeArrayLen0 is any zero-length array type (like [0]int).
ExpectTypeBool is type `bool`.
ExpectTypeBoolString is type `bool` with `json:",string"` tag.
ExpectTypeEmptyStruct is type `struct{}`.
ExpectTypeFloat32 is type `float32`.
ExpectTypeFloat32String is type `float32` with `json:",string"` tag.
ExpectTypeFloat64 is type `float64`.
ExpectTypeFloat64String is type `float32` with `json:",string"` tag.
ExpectTypeInt is type `int`.
ExpectTypeInt16 is type `int16`.
ExpectTypeInt16String is type `int16` with `json:",string"` tag.
ExpectTypeInt32 is type `int32`.
ExpectTypeInt32String is type `int32` with `json:",string"` tag.
ExpectTypeInt64 is type `int64`.
ExpectTypeInt64String is type `int64` with `json:",string"` tag.
ExpectTypeInt8 is type `int8`.
ExpectTypeInt8String is type `int8` with `json:",string"` tag.
ExpectTypeIntString is type `int` with `json:",string"` tag.
ExpectTypeJSONUnmarshaler is any type that implements the encoding/json.Unmarshaler interface.
ExpectTypeMap is any map type.
ExpectTypeMapRecur is any recursive map type (used for recursive struct fields).
ExpectTypeMapStringString is `map[string]string`.
ExpectTypeNumber is the type `jscandec.Number`.
ExpectTypePtr is any pointer type.
ExpectTypePtrRecur is any recursive pointer type (used for recursive struct fields).
ExpectTypeSlice is any slice type.
ExpectTypeSliceBool is type `[]bool`.
ExpectTypeSliceEmptyStruct is type `[]struct{}`.
ExpectTypeSliceFloat32 is type `[]float32`.
ExpectTypeSliceFloat64 is type `[]float64`.
ExpectTypeSliceInt is type `[]int`.
ExpectTypeSliceInt16 is type `[]int16`.
ExpectTypeSliceInt32 is type `[]int32`.
ExpectTypeSliceInt64 is type `[]int64`.
ExpectTypeSliceInt8 is type `[]int8`.
ExpectTypeSliceRecur is a recursive slice type (used for recursive struct fields).
ExpectTypeSliceString is type `[]string`.
ExpectTypeSliceUint is type `[]uint`.
ExpectTypeSliceUint16 is type `[]uint16`.
ExpectTypeSliceUint32 is type `[]uint32`.
ExpectTypeSliceUint64 is type `[]uint64`.
ExpectTypeSliceUint8 is type `[]uint8`.
ExpectTypeStr is type `string`.
ExpectTypeStrString is type `string` with `json:",string"` tag.
ExpectTypeStruct is any struct type except `struct{}`.
ExpectTypeStruct is any recursive struct type.
ExpectTypeTextUnmarshaler is any type that implements the encoding.TextUnmarshaler interface.
ExpectTypeUint is type `uint`.
ExpectTypeUint16 is type `uint16`.
ExpectTypeUint16String is type `uint16` with `json:",string"` tag.
ExpectTypeUint32 is type `uint32`.
ExpectTypeUint32String is type `uint32` with `json:",string"` tag.
ExpectTypeUint64 is type `uint64`.
ExpectTypeUint64String is type `uint64` with `json:",string"` tag.
ExpectTypeUint8 is type `uint8`.
ExpectTypeUint8String is type `uint8` with `json:",string"` tag.
ExpectTypeUintString is type `uint` with `json:",string"` tag.

# Variables

DefaultInitOptions are to be used by default.
DefaultOptions are to be used by default.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

DecodeOptions are options for the method *Decoder[S, T].Decode.
Decoder is a reusable decoder instance.
InitOptions are options for the constructor function NewDecoder[S, T].

# Type aliases

No description provided by the author
Number represents a JSON number literal.