Documentation ¶
Index ¶
Constants ¶
const JsonNull = "null"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilteredInterface ¶
type FilteredInterface struct { IsSet bool Value interface{} }
func (FilteredInterface) MarshalJSON ¶
func (n FilteredInterface) MarshalJSON() ([]byte, error)
func (*FilteredInterface) UnmarshalJSON ¶
func (n *FilteredInterface) UnmarshalJSON(rawJSON []byte) error
type FilteredString ¶
FilteredString is a wrapper around string values that can be null/default or an actual value. Use IsSet to check if the value is provided, instead of checking against the empty string.
func NewFilteredString ¶
func NewFilteredString(val string) *FilteredString
func (FilteredString) IsDefault ¶
func (n FilteredString) IsDefault() bool
func (FilteredString) MarshalJSON ¶
func (n FilteredString) MarshalJSON() ([]byte, error)
MarshalJSON marshals the value field if it's not empty, otherwise returns an null.
func (*FilteredString) ParseValue ¶
func (n *FilteredString) ParseValue(val string)
ParseValue is used to parse a user provided flag argument.
func (FilteredString) String ¶
func (n FilteredString) String() string
func (*FilteredString) UnmarshalJSON ¶
func (n *FilteredString) UnmarshalJSON(rawJSON []byte) error
type FilteredStrings ¶
type FilteredStrings []FilteredString
func (FilteredStrings) String ¶
func (n FilteredStrings) String() string
type JSONObject ¶
type JSONObject map[string]interface{}
JSONObject represents a JSON object. When not initialized it serializes to `{}`, whereas a `map[string]interface{}` serializes to `null`.
func (JSONObject) MarshalJSON ¶
func (j JSONObject) MarshalJSON() ([]byte, error)
type NullBool ¶
NullBool is a wrapper around bool values that can be null or an bool. Use IsSet to check if the value is provided, instead of checking against false.
func (NullBool) MarshalJSON ¶
func (*NullBool) ParseBoolValue ¶
ParseBoolValue is used to parse a user provided *bool argument.
func (*NullBool) ParseStringValue ¶
ParseStringValue is used to parse a user provided flag argument.
func (*NullBool) UnmarshalJSON ¶
type NullByteSizeInMb ¶
NullByteSizeInMb represents size in a byte format in megabytes.
func (*NullByteSizeInMb) ParseStringValue ¶
func (b *NullByteSizeInMb) ParseStringValue(value string) error
func (*NullByteSizeInMb) ParseUint64Value ¶
func (b *NullByteSizeInMb) ParseUint64Value(val *uint64)
ParseUint64Value is used to parse a user provided *uint64 argument.
func (NullByteSizeInMb) String ¶
func (b NullByteSizeInMb) String() string
func (*NullByteSizeInMb) UnmarshalJSON ¶
func (b *NullByteSizeInMb) UnmarshalJSON(rawJSON []byte) error
type NullInt ¶
NullInt is a wrapper around integer values that can be null or an integer. Use IsSet to check if the value is provided, instead of checking against 0.
func (*NullInt) IsValidValue ¶
IsValidValue returns an error if the input value is not an integer.
func (NullInt) MarshalJSON ¶
func (*NullInt) ParseIntValue ¶
ParseIntValue is used to parse a user provided *int argument.
func (*NullInt) ParseStringValue ¶
ParseStringValue is used to parse a user provided flag argument.
func (*NullInt) UnmarshalFlag ¶
func (*NullInt) UnmarshalJSON ¶
type NullString ¶
func NewNullString ¶
func NewNullString(optionalValue ...string) NullString
func (NullString) MarshalJSON ¶
func (n NullString) MarshalJSON() ([]byte, error)
func (*NullString) UnmarshalJSON ¶
func (n *NullString) UnmarshalJSON(rawJSON []byte) error
type NullUint64 ¶
NullUint64 is a wrapper around uint64 values that can be null or an unint64. Use IsSet to check if the value is provided, instead of checking against 0.
func (*NullUint64) ParseStringValue ¶
func (n *NullUint64) ParseStringValue(val string) error
ParseStringValue is used to parse a user provided flag argument.
func (*NullUint64) UnmarshalJSON ¶
func (n *NullUint64) UnmarshalJSON(rawJSON []byte) error
type OptionalBoolean ¶
func NewOptionalBoolean ¶
func NewOptionalBoolean(value bool) OptionalBoolean
func (OptionalBoolean) MarshalJSON ¶
func (o OptionalBoolean) MarshalJSON() ([]byte, error)
func (OptionalBoolean) OmitJSONry ¶
func (o OptionalBoolean) OmitJSONry() bool
func (*OptionalBoolean) UnmarshalJSON ¶
func (o *OptionalBoolean) UnmarshalJSON(rawJSON []byte) error
type OptionalObject ¶
OptionalObject is for situations where we want to differentiate between an empty object, and the object not having been set. An example would be an optional command line option where we want to tell the difference between it being set to an empty object, and it not being specified at all.
func NewOptionalObject ¶
func NewOptionalObject(v map[string]interface{}) OptionalObject
func (OptionalObject) MarshalJSON ¶
func (o OptionalObject) MarshalJSON() ([]byte, error)
func (OptionalObject) OmitJSONry ¶
func (o OptionalObject) OmitJSONry() bool
func (*OptionalObject) UnmarshalJSON ¶
func (o *OptionalObject) UnmarshalJSON(rawJSON []byte) error
type OptionalString ¶
func NewOptionalString ¶
func NewOptionalString(v string) OptionalString
func (OptionalString) MarshalJSON ¶
func (o OptionalString) MarshalJSON() ([]byte, error)
func (OptionalString) OmitJSONry ¶
func (o OptionalString) OmitJSONry() bool
func (OptionalString) String ¶
func (o OptionalString) String() string
func (*OptionalString) UnmarshalJSON ¶
func (o *OptionalString) UnmarshalJSON(rawJSON []byte) error
type OptionalStringSlice ¶
func NewOptionalStringSlice ¶
func NewOptionalStringSlice(s ...string) OptionalStringSlice
func (OptionalStringSlice) MarshalJSON ¶
func (o OptionalStringSlice) MarshalJSON() ([]byte, error)
func (OptionalStringSlice) OmitJSONry ¶
func (o OptionalStringSlice) OmitJSONry() bool
func (OptionalStringSlice) String ¶
func (o OptionalStringSlice) String() string
func (*OptionalStringSlice) UnmarshalJSON ¶
func (o *OptionalStringSlice) UnmarshalJSON(rawJSON []byte) error