introspectfx

package
v0.0.0-...-7b96089 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AugmentObservablesByReflection

func AugmentObservablesByReflection(tb *TypeBuilder) error

func RegisterAugmenter

func RegisterAugmenter(aug TypeAugmenter)

func RegisterProperty

func RegisterProperty(typ Type, prop Property)

func RegisterPropertyFunc

func RegisterPropertyFunc[T, V any](name string, fn func(T) V)

func RegisterPropertyMethod

func RegisterPropertyMethod[T any](name string)

Types

type Node

type Node interface {
	Value

	IsLeaf() bool
	Children() collectionsfx2.ObservableList[Node]
}

func Introspect

func Introspect(value interface{}) Node

func IntrospectValue

func IntrospectValue(value Value) Node

type Path

type Path []string

type Property

type Property interface {
	Name() string
	Type() Type

	IsList() bool
	IsMap() bool
	IsSet() bool

	IsObservable() bool
	AsObservable(receiver Value) obsfx2.Observable

	GetRawValue(receiver Value) reflect.Value
	GetValue(receiver Value) Value
}

type Type

type Type interface {
	Name() string
	RuntimeType() reflect.Type

	Property(name string) Property
	Properties() []Property
}

func TypeFor

func TypeFor(t reflect.Type) Type

func TypeOf

func TypeOf(val any) Type

type TypeAugmenter

type TypeAugmenter interface {
	AugmentType(tb *TypeBuilder) error
}

type TypeAugmenterFunc

type TypeAugmenterFunc func(tb *TypeBuilder) error

func (TypeAugmenterFunc) AugmentType

func (t TypeAugmenterFunc) AugmentType(tb *TypeBuilder) error

type TypeBuilder

type TypeBuilder struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewTypeBuilder

func NewTypeBuilder(name string, runtimeType reflect.Type) *TypeBuilder

func (*TypeBuilder) Build

func (tb *TypeBuilder) Build() Type

func (*TypeBuilder) IsDirty

func (tb *TypeBuilder) IsDirty() bool

func (*TypeBuilder) Name

func (tb *TypeBuilder) Name() string

func (*TypeBuilder) Properties

func (tb *TypeBuilder) Properties() []Property

func (*TypeBuilder) Property

func (tb *TypeBuilder) Property(name string) Property

func (*TypeBuilder) RuntimeType

func (tb *TypeBuilder) RuntimeType() reflect.Type

func (*TypeBuilder) WithProperties

func (tb *TypeBuilder) WithProperties(props ...Property) *TypeBuilder

func (*TypeBuilder) WithProperty

func (tb *TypeBuilder) WithProperty(prop Property) *TypeBuilder

type Value

type Value interface {
	Go() reflect.Value
	Type() Type
}

func ValueFor

func ValueFor(val reflect.Value) Value

func ValueOf

func ValueOf(val any) Value

Jump to

Keyboard shortcuts

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