Documentation ¶
Index ¶
- Variables
- type GuessData
- func (g GuessData) IsArray() bool
- func (g GuessData) IsBoolean() bool
- func (g *GuessData) IsFloat() bool
- func (g *GuessData) IsInteger() bool
- func (g GuessData) IsNull() bool
- func (g GuessData) IsObject() bool
- func (g GuessData) IsShortcut() bool
- func (g GuessData) IsString() bool
- func (g GuessData) JsonType() Type
- func (g GuessData) LiteralJsonType() Type
- func (g *GuessData) Number() (*Number, error)
- type Number
- func (n Number) Cmp(nn *Number) int
- func (n Number) Equal(nn *Number) bool
- func (n Number) GreaterThan(nn *Number) bool
- func (n Number) GreaterThanOrEqual(nn *Number) bool
- func (n Number) LengthOfFractionalPart() uint
- func (n Number) LessThan(nn *Number) bool
- func (n Number) LessThanOrEqual(nn *Number) bool
- func (n Number) String() string
- func (n Number) ToFloat() float64
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var AllTypes = []Type{ TypeObject, TypeArray, TypeString, TypeInteger, TypeFloat, TypeBoolean, TypeNull, TypeMixed, }
Functions ¶
This section is empty.
Types ¶
type GuessData ¶
type GuessData struct {
// contains filtered or unexported fields
}
func (GuessData) IsShortcut ¶
func (GuessData) LiteralJsonType ¶
type Number ¶
type Number struct {
// contains filtered or unexported fields
}
Number provides a method to work with numbers in the understanding of JSON (for example -1.2 e+3).
func (Number) Cmp ¶
Cmp compares the numbers represented by n and nn and returns:
-1 if n < nn 0 if n == nn +1 if n > nn.
func (Number) GreaterThan ¶
GreaterThan (GT) returns true when n is greater than nn.
func (Number) GreaterThanOrEqual ¶
GreaterThanOrEqual (GTE) returns true when n is greater than or equal to nn.
func (Number) LengthOfFractionalPart ¶
func (Number) LessThanOrEqual ¶
LessThanOrEqual (LTE) returns true when n is less than or equal to nn.
type Type ¶
type Type uint8
const ( // TypeUndefined default value for literal and mixed nodes. TypeUndefined Type = iota TypeObject TypeArray TypeString TypeInteger // TypeFloat to be precise, there is no separate "Integer" and "Float" in JSON, // there is a single "Number" type. But in our case, we will assume that there is. TypeFloat TypeBoolean TypeNull // TypeMixed indicates that here can be anything. TypeMixed )
func NewJsonType ¶
func (Type) IsLiteralType ¶
func (Type) ToTokenType ¶
Click to show internal directories.
Click to hide internal directories.