Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NumberOrString ¶
NumberOrString is value that can a JSON number or string.
func FromFloat64 ¶
func FromFloat64(val float64) NumberOrString
FromFloat64 returns the supplied value as a NumberOrString
func FromInt64 ¶
func FromInt64(val int64) NumberOrString
FromInt64 returns the supplied value as a NumberOrString
func FromNumber ¶
func FromNumber(val json.Number) NumberOrString
FromNumber returns the supplied value as a NumberOrString
func FromString ¶
func FromString(val string) NumberOrString
FromString returns the supplied value as a NumberOrString
func (*NumberOrString) Float64Value ¶
func (s *NumberOrString) Float64Value() float64
Float64Value coerces the value to a float64.
func (*NumberOrString) Int64Value ¶
func (s *NumberOrString) Int64Value() int64
Int64Value coerces the value to an int64.
func (NumberOrString) MarshalJSON ¶
func (s NumberOrString) MarshalJSON() ([]byte, error)
MarshalJSON writes the value with the appropriate type.
func (*NumberOrString) String ¶
func (s *NumberOrString) String() string
String coerces the value to a string.
func (*NumberOrString) UnmarshalJSON ¶
func (s *NumberOrString) UnmarshalJSON(b []byte) error
UnmarshalJSON reads the value from either a string or number.
Click to show internal directories.
Click to hide internal directories.