Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clean ¶
Clean removes non-graphic characters from the given string, see https://github.com/icza/gox/blob/master/stringsx/stringsx.go#L9 and https://stackoverflow.com/a/58994297/639133 However, above function also removes newlines, that is not desired?
Types ¶
type Bool ¶
type Bool struct {
Bool bool
}
Bool can be used to decode any JSON value to bool. Empty strings as well as "false" and "0" evaluate to false, all other strings are true. Numbers equal to 0 will evaluate to false, all other numbers are true.
func (Bool) MarshalText ¶ added in v1.1.0
func (*Bool) UnmarshalJSON ¶
UnmarshalJSON method for Bool
func (*Bool) UnmarshalText ¶ added in v1.1.2
type Float ¶
type Float struct {
Float64 float64
}
Float can be used to decode any JSON value to int64. Strings that are not valid representation of a number will error. Boolean values will error
func (Float) MarshalJSON ¶
MarshalJSON method for Float
func (Float) MarshalText ¶ added in v1.1.0
func (*Float) UnmarshalJSON ¶
UnmarshalJSON method for Float
func (*Float) UnmarshalText ¶ added in v1.1.2
type Int ¶
type Int struct {
Int64 int64
}
Int can be used to decode any JSON value to int64. Strings that are not valid representation of a number will error. Boolean values will error
func (Int) MarshalText ¶ added in v1.1.0
func (*Int) UnmarshalJSON ¶
UnmarshalJSON method for Int
func (*Int) UnmarshalText ¶ added in v1.1.2
type NBool ¶ added in v1.0.1
NBool can be used to decode any JSON value to bool. Empty strings as well as "false" and "0" evaluate to false, all other strings are true. Numbers equal to 0 will evaluate to false, all other numbers are true.
func (NBool) MarshalJSON ¶ added in v1.0.1
MarshalJSON method for Bool
func (NBool) MarshalText ¶ added in v1.1.0
func (*NBool) UnmarshalJSON ¶ added in v1.0.1
UnmarshalJSON method for Bool
func (*NBool) UnmarshalText ¶ added in v1.1.2
type NFloat ¶ added in v1.0.1
NFloat can be used to decode any JSON value to int64. Strings that are not valid representation of a number will error. Boolean values will error
func NFloatFrom ¶ added in v1.0.1
func (NFloat) MarshalJSON ¶ added in v1.0.1
MarshalJSON method for Float
func (NFloat) MarshalText ¶ added in v1.1.0
func (*NFloat) UnmarshalJSON ¶ added in v1.0.1
UnmarshalJSON method for Float
func (*NFloat) UnmarshalText ¶ added in v1.1.2
type NInt ¶ added in v1.0.1
NInt can be used to decode any JSON value to int64. Strings that are not valid representation of a number will error. Boolean values will error
func NIntFromString ¶ added in v1.1.2
NIntFromString returns an Int for the given string
func (NInt) MarshalJSON ¶ added in v1.0.1
MarshalJSON method for Int
func (NInt) MarshalText ¶ added in v1.1.0
func (*NInt) UnmarshalJSON ¶ added in v1.0.1
UnmarshalJSON method for Int
func (*NInt) UnmarshalText ¶ added in v1.1.2
type NString ¶ added in v1.0.1
NString can be used to decode any JSON value to string
func NStringFrom ¶ added in v1.0.1
func (NString) MarshalJSON ¶ added in v1.0.1
MarshalJSON method with value receiver for String Method must not have a pointer receiver! See https://stackoverflow.com/a/21394657/639133
func (NString) MarshalText ¶ added in v1.1.0
func (*NString) UnmarshalJSON ¶ added in v1.0.1
UnmarshalJSON for String
func (*NString) UnmarshalText ¶ added in v1.1.2
type String ¶
type String struct {
String string
}
String can be used to decode any JSON value to string
func StringFrom ¶
func (String) MarshalJSON ¶
MarshalJSON method with value receiver for String Method must not have a pointer receiver! See https://stackoverflow.com/a/21394657/639133
func (String) MarshalText ¶ added in v1.1.0
func (*String) UnmarshalJSON ¶
UnmarshalJSON for String