GValue
The central type representing any GLYPH value.Type System
GType Enumeration
Constructors
Create GLYPH values using type-specific constructors:Scalar Constructors
Creates a null value.
Creates a boolean value.
Creates an integer value.
Creates a float value.
Creates a string value.
Creates a bytes value.
Creates a time value.
Creates a reference ID value.
Container Constructors
Creates a list value.
Creates a map value.
Creates a typed struct value.
Creates a tagged union value.
Helper Functions
Creates a map entry for use in Map/Struct constructors.
Accessors
Extract typed values from GValue instances:Type Checking
Returns the value’s type.
Returns true if value is null.
Scalar Accessors
Extracts boolean value or returns error.
Extracts integer value or returns error.
Extracts float value or returns error.
Extracts string value or returns error.
Extracts bytes value or returns error.
Extracts time value or returns error.
Extracts reference ID or returns error.
Container Accessors
Extracts list elements or returns error.
Extracts map entries or returns error.
Extracts struct value or returns error.
Extracts sum value or returns error.
Field Access
Returns field value by key from map or struct, or nil if not found.
Returns i-th element of a list or returns error.
Returns length of list, map, or struct.
Mutation
Sets field value on a map or struct.
Appends value to a list.
Supporting Types
RefID
Represents a reference identifier.MapEntry
Represents a key-value pair.StructValue
Represents a typed struct.SumValue
Represents a tagged union.Bridge Functions
Convert between GLYPH and other formats:SJSON Conversion
Converts GValue to SJSON value.
Converts SJSON value to GValue.
JSON Conversion
Converts GValue to JSON bytes.
Parses JSON bytes into GValue.
Go Native Conversion
Converts GValue to Go any (interface) for JSON/Gen1 interop.
Converts Go any (interface) to GValue.
Binary Encoding
Encodes GValue to SJSON binary format.
Decodes SJSON binary format to GValue.