Documentation
¶
Index ¶
- type StringAnyMap
- type Typ
- func (j *Typ) AsByteSlice() []byte
- func (j *Typ) GetTopLevelElement(key string) any
- func (j *Typ) HasTopLevelArray() bool
- func (j *Typ) IsEmpty() bool
- func (j *Typ) IsNotEmpty() bool
- func (j Typ) MarshalJSON() ([]byte, error)
- func (j *Typ) PrettyString() string
- func (j *Typ) Scan(value any) error
- func (j *Typ) SetNewTopLevelElement(key string, value any) (replacedExistingKey bool)
- func (j *Typ) String() string
- func (j *Typ) UnmarshalJSON(dataToUnmarshal []byte) error
- func (j *Typ) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StringAnyMap ¶
type Typ ¶
type Typ struct {
Valid bool
StringAnyMap
// contains filtered or unexported fields
}
var NullJsonObject Typ
func EmptyNotNullJsonObject ¶
func EmptyNotNullJsonObject() Typ
EmptyNotNullJsonObject returns a new blank Typ NOTE: We cannot use a var for the EmptyNotNullJsonObject value because when we copy a lot of values around and
assign the var to multiple values throughout the program in multiple goroutines, we might get the panic message "concurrent map read and map write" indicating that the value is being written and read simultaneously because the same variable is being used at multiple places
func NewJsonObject ¶
func ToJsonObject ¶
ToJsonObject will convert any object type to Typ using json.Marshal and json.Unmarshal
func (*Typ) AsByteSlice ¶
func (*Typ) GetTopLevelElement ¶
GetTopLevelElement will return Top-Level element identified by key. If the key does not exist, nil is returned
func (*Typ) HasTopLevelArray ¶
func (*Typ) IsNotEmpty ¶
func (Typ) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface
func (*Typ) PrettyString ¶
PrettyString will give the formatted string for this Typ
func (*Typ) Scan ¶
Scan implements the sql.Scanner interface. This method decodes a JSON-encoded value into the struct fields.
func (*Typ) SetNewTopLevelElement ¶
func (*Typ) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
Click to show internal directories.
Click to hide internal directories.