Documentation
¶
Overview ¶
Package shtypes container wrappers for handling JSON types that may or may not be weird e.g.: numbers as strings or numbers, bools as anything that looks truthy it adds a little more flexibility around some of the types than the json.Number and related classes
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MaybeBigInt ¶
type MaybeBigInt int64
MaybeBigInt is a simple wrapper unmarshalling json responses that could be either an int or an int in a string.
func (*MaybeBigInt) UnmarshalJSON ¶
func (fi *MaybeBigInt) UnmarshalJSON(b []byte) error
UnmarshalJSON is a helper interface for dealing with numbers that may be returned in json responses as either a string with a number in it or numbers.
type MaybeBool ¶
type MaybeBool bool
MaybeBool is a simple wrapper unmarshalling json responses that could be either an int or an int in a string.
func (*MaybeBool) UnmarshalJSON ¶
UnmarshalJSON is a helper interface for dealing with things that may or may not be a string representing a bool, or number representing a bool.
type MaybeString ¶
type MaybeString string
MaybeString is for things that may or may not be strings, but should be represented as a string.
func (*MaybeString) UnmarshalJSON ¶
func (fi *MaybeString) UnmarshalJSON(b []byte) error
UnmarshalJSON is a helper interface for dealing with numbers that should be strings, but sometimes come through as number.