data

package
v0.0.0-...-bea3eb9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2025 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataType

type DataType int
const (
	DATA_TYPE_INVALID DataType = iota
	DATA_TYPE_NULL
	DATA_TYPE_BOOLEAN
	DATA_TYPE_INTEGER
	DATA_TYPE_FLOAT
	DATA_TYPE_STRING
	DATA_TYPE_OBJECT
	DATA_TYPE_ARRAY
)

func (DataType) ToString

func (r DataType) ToString() string

type DataValue

type DataValue struct {
	// contains filtered or unexported fields
}

func NewArray

func NewArray() *DataValue

func NewBoolean

func NewBoolean(value bool) *DataValue

func NewDataValue

func NewDataValue() *DataValue

func NewFloat

func NewFloat(value float64) *DataValue

func NewInteger

func NewInteger(value int64) *DataValue

func NewNull

func NewNull() *DataValue

func NewObject

func NewObject() *DataValue

func NewString

func NewString(value string) *DataValue

func (*DataValue) AppendArrayValue

func (r *DataValue) AppendArrayValue(dataValue *DataValue) *DataValue

func (*DataValue) Clone

func (r *DataValue) Clone() *DataValue

Clone a deep copy of this entire thing; all pointers dereferenced and copied by value

func (*DataValue) DropObjectProperties

func (r *DataValue) DropObjectProperties(names ...string) *DataValue

func (*DataValue) DropObjectProperty

func (r *DataValue) DropObjectProperty(name string) *DataValue

func (*DataValue) GetArraySize

func (r *DataValue) GetArraySize() int

func (*DataValue) GetArrayValue

func (r *DataValue) GetArrayValue(index int) *DataValue

func (*DataValue) GetBoolean

func (r *DataValue) GetBoolean() bool

func (*DataValue) GetError

func (r *DataValue) GetError() error

func (*DataValue) GetFloat

func (r *DataValue) GetFloat() float64

func (*DataValue) GetInteger

func (r *DataValue) GetInteger() int64

func (*DataValue) GetIterator

func (r *DataValue) GetIterator() func() interface{}

Returns iterator func of []KeyValuePair for Objects, []*DataValue for Arrays, nil for other types

func (*DataValue) GetMissing

func (r *DataValue) GetMissing(selectors ...string) []string

func (*DataValue) GetMissingObjectProperties

func (r *DataValue) GetMissingObjectProperties(names ...string) *[]string

func (*DataValue) GetObjectProperties

func (r *DataValue) GetObjectProperties() []string

func (*DataValue) GetObjectProperty

func (r *DataValue) GetObjectProperty(name string) *DataValue

func (*DataValue) GetString

func (r *DataValue) GetString() string

func (*DataValue) GetType

func (r *DataValue) GetType() DataType

func (*DataValue) HasAll

func (r *DataValue) HasAll(selectors ...string) bool

func (*DataValue) HasAllObjectProperties

func (r *DataValue) HasAllObjectProperties(names ...string) bool

func (*DataValue) HasObjectProperty

func (r *DataValue) HasObjectProperty(name string) bool

func (*DataValue) IsArray

func (r *DataValue) IsArray() bool

func (*DataValue) IsBoolean

func (r *DataValue) IsBoolean() bool

func (*DataValue) IsFloat

func (r *DataValue) IsFloat() bool

func (*DataValue) IsImmutable

func (r *DataValue) IsImmutable() bool

func (*DataValue) IsInteger

func (r *DataValue) IsInteger() bool

func (*DataValue) IsNull

func (r *DataValue) IsNull() bool

func (*DataValue) IsObject

func (r *DataValue) IsObject() bool

func (*DataValue) IsString

func (r *DataValue) IsString() bool

func (*DataValue) IsValid

func (r *DataValue) IsValid() bool

func (*DataValue) Merge

func (r *DataValue) Merge(dataValue DataValueIfc) *DataValue

func (*DataValue) PrepareArray

func (r *DataValue) PrepareArray() *DataValue

func (*DataValue) PrepareObject

func (r *DataValue) PrepareObject() *DataValue

func (*DataValue) ReplaceArrayValue

func (r *DataValue) ReplaceArrayValue(index int, dataValue *DataValue) *DataValue

func (*DataValue) Select

func (r *DataValue) Select(selector string) *DataValue

func (*DataValue) SetBoolean

func (r *DataValue) SetBoolean(value bool) *DataValue

func (*DataValue) SetFloat

func (r *DataValue) SetFloat(value float64) *DataValue

func (*DataValue) SetImmutable

func (r *DataValue) SetImmutable() *DataValue

func (*DataValue) SetInteger

func (r *DataValue) SetInteger(value int64) *DataValue

func (*DataValue) SetNull

func (r *DataValue) SetNull() *DataValue

func (*DataValue) SetObjectProperty

func (r *DataValue) SetObjectProperty(name string, dataValue *DataValue) *DataValue

func (*DataValue) SetString

func (r *DataValue) SetString(value string) *DataValue

func (*DataValue) ToJson

func (r *DataValue) ToJson() string

func (*DataValue) ToString

func (r *DataValue) ToString() string

type DataValueIfc

type DataValueIfc interface {
	iterable.IterableIfc

	// State
	IsValid() bool
	GetType() DataType
	GetError() error
	IsImmutable() bool
	SetImmutable() *DataValue

	// Nulls
	IsNull() bool
	SetNull() *DataValue

	// Strings
	IsString() bool
	GetString() string
	SetString(value string) *DataValue

	// Objects
	IsObject() bool
	PrepareObject() *DataValue
	SetObjectProperty(name string, dataValue *DataValue) *DataValue
	DropObjectProperty(name string) *DataValue
	HasObjectProperty(name string) bool
	GetObjectProperties() []string
	GetObjectProperty(name string) *DataValue
	HasAllObjectProperties(names ...string) bool
	GetMissingObjectProperties(names ...string) *[]string
	DropObjectProperties(names ...string) *DataValue

	// Booleans
	IsBoolean() bool
	GetBoolean() bool
	SetBoolean(value bool) *DataValue

	// Arrays
	IsArray() bool
	PrepareArray() *DataValue
	GetArraySize() int
	GetArrayValue(index int) *DataValue
	AppendArrayValue(dataValue *DataValue) *DataValue
	ReplaceArrayValue(index int, dataValue *DataValue) *DataValue

	// Floats
	IsFloat() bool
	GetFloat() float64
	SetFloat(value float64) *DataValue

	// Integers
	IsInteger() bool
	GetInteger() int64
	SetInteger(value int64) *DataValue

	// Modern amenities ;^)
	Select(selector string) *DataValue
	HasAll(selectors ...string) bool
	GetMissing(selectors ...string) []string
	Merge(dataValue DataValueIfc) *DataValue
	ToString() string
	ToJson() string
	Clone() *DataValue
}

type IndexValuePair

type IndexValuePair struct {
	Index int
	Value *DataValue
}

type KeyValuePair

type KeyValuePair struct {
	Key   string
	Value *DataValue
}

Directories

Path Synopsis
DigiStratum GoLib - ByteMap
DigiStratum GoLib - ByteMap
DigiStratum GoLib - HashMap
DigiStratum GoLib - HashMap
DigiStratum GoLib - JSON
DigiStratum GoLib - JSON
DigiStratum GoLib - Transcoder for plain text content
DigiStratum GoLib - Transcoder for plain text content

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL