Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
func Parse(runescanner io.RuneScanner, dst *NaturalNumber) error
Parse tries to parse a JSON natural-number literal. If it succeeds, then it return nil, and sets ‘dst’ to the parsed value. If it failed, it returns an error.
Example usage:
var rs io.RuneScaner // ... var value rfc8259naturalnumber.NaturalNumber err := rfc8259naturalnumber.Parse(rs, &value) if nil != err { return err } fmt.Printf("value = %#v\n", value)
Types ¶
type NaturalNumber ¶
type NaturalNumber struct { opt.Optional[string] }
NaturalNumber represents the numbers: ..., -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7,....
I.e., the set of positive-integers, negative-integers, and zero.
From IETF RFC-8259 NaturalNumber represents the following:
[ minus ] int
This is part of the definition of:
number = [ minus ] int [ frac ] [ exp ]
Since a NaturalNumber is a common usage of a JSON number, NaturalNumber exists.
func NegativeOne ¶
func NegativeOne() NaturalNumber
func Nothing ¶
func Nothing() NaturalNumber
func One ¶
func One() NaturalNumber
func Something ¶
func Something(value string) NaturalNumber
func Zero ¶
func Zero() NaturalNumber
func (NaturalNumber) GoString ¶
func (receiver NaturalNumber) GoString() string
Click to show internal directories.
Click to hide internal directories.