types

package
v0.0.0-...-5d14d19 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const FieldID = "__ID__"
View Source
const FieldSelf = "__Self__"

Variables

View Source
var ErrFieldNotFound = errors.New("field not found")

Functions

func UnwrapTestValue

func UnwrapTestValue(v any) any

Types

type GVFloat

type GVFloat float64

func (GVFloat) Equal

func (v GVFloat) Equal(w GValue) bool

func (GVFloat) GetField

func (v GVFloat) GetField(f string) (GValue, any, error)

func (GVFloat) Hash

func (v GVFloat) Hash() uint64

func (GVFloat) RType

func (v GVFloat) RType() reflect.Type

func (GVFloat) ToGoValue

func (v GVFloat) ToGoValue() any

func (GVFloat) Type

func (GVFloat) Type() GValueType

type GVIdentity

type GVIdentity string

func (GVIdentity) Equal

func (v GVIdentity) Equal(w GValue) bool

func (GVIdentity) GetField

func (v GVIdentity) GetField(f string) (GValue, any, error)

func (GVIdentity) Hash

func (v GVIdentity) Hash() uint64

func (GVIdentity) RType

func (v GVIdentity) RType() reflect.Type

func (GVIdentity) ToGoValue

func (v GVIdentity) ToGoValue() any

func (GVIdentity) Type

func (GVIdentity) Type() GValueType

type GVInt

type GVInt int64

func (GVInt) Equal

func (v GVInt) Equal(w GValue) bool

func (GVInt) GetField

func (v GVInt) GetField(f string) (GValue, any, error)

func (GVInt) Hash

func (v GVInt) Hash() uint64

func (GVInt) RType

func (v GVInt) RType() reflect.Type

func (GVInt) ToGoValue

func (v GVInt) ToGoValue() any

func (GVInt) Type

func (GVInt) Type() GValueType

type GVNil

type GVNil struct {
}

func NewGVNil

func NewGVNil() *GVNil

func (*GVNil) Equal

func (v *GVNil) Equal(w GValue) bool

func (*GVNil) GetField

func (v *GVNil) GetField(f string) (GValue, any, error)

func (*GVNil) Hash

func (v *GVNil) Hash() uint64

func (*GVNil) RType

func (v *GVNil) RType() reflect.Type

func (*GVNil) ToGoValue

func (v *GVNil) ToGoValue() any

func (*GVNil) Type

func (*GVNil) Type() GValueType

type GVString

type GVString string

func (GVString) Equal

func (v GVString) Equal(w GValue) bool

func (GVString) GetField

func (v GVString) GetField(f string) (GValue, any, error)

func (GVString) Hash

func (v GVString) Hash() uint64

func (GVString) RType

func (v GVString) RType() reflect.Type

func (GVString) ToGoValue

func (v GVString) ToGoValue() any

func (GVString) Type

func (GVString) Type() GValueType

type GVStruct

type GVStruct struct {
	V any // the actual struct
}

func NewGVStruct

func NewGVStruct(v any) *GVStruct

func (GVStruct) Equal

func (v GVStruct) Equal(w GValue) bool

func (GVStruct) GetField

func (v GVStruct) GetField(f string) (GValue, any, error)

GetField extract field value by field name `f`, wrap it into TestValue and return it

func (GVStruct) HasField

func (v GVStruct) HasField(f string) bool

func (GVStruct) Hash

func (v GVStruct) Hash() uint64

func (GVStruct) RType

func (v GVStruct) RType() reflect.Type

func (GVStruct) ToGoValue

func (v GVStruct) ToGoValue() any

func (GVStruct) Type

func (GVStruct) Type() GValueType

func (GVStruct) Value

func (v GVStruct) Value() any

type GVUint

type GVUint uint64

func (GVUint) Equal

func (v GVUint) Equal(w GValue) bool

func (GVUint) GetField

func (v GVUint) GetField(f string) (GValue, any, error)

func (GVUint) Hash

func (v GVUint) Hash() uint64

func (GVUint) RType

func (v GVUint) RType() reflect.Type

func (GVUint) ToGoValue

func (v GVUint) ToGoValue() any

func (GVUint) Type

func (GVUint) Type() GValueType

type GValue

type GValue interface {
	Hash() uint64
	Type() GValueType
	RType() reflect.Type
	GetField(string) (GValue, any, error)
	Equal(GValue) bool
	ToGoValue() any
	// contains filtered or unexported methods
}

type GValueType

type GValueType uint8
const (
	GValueTypeUnknown GValueType = iota
	GValueTypeNil
	GValueTypeIdentity
	GValueTypeInt
	GValueTypeUint
	GValueTypeFloat
	GValueTypeString
	GValueTypeStruct
)

TestValueType

func (GValueType) RType

func (t GValueType) RType() reflect.Type

func (GValueType) String

func (t GValueType) String() string

type TypeInfo

type TypeInfo struct {
	T      GValueType
	Fields map[string]GValueType
	VT     reflect.Type
}

type info of an Alias

func (TypeInfo) Hash

func (v TypeInfo) Hash() uint64

Jump to

Keyboard shortcuts

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