component_definition

package
v1.5.25 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgType

type ArgType string
const (
	ArgRequired  ArgType = "Required"
	ArgQualifier ArgType = "Qualifier"
)

type Base

type Base struct {
	Type  reflect.Type
	Value reflect.Value
	// contains filtered or unexported fields
}

func NewBase

func NewBase(c any) *Base

type Field

type Field struct {
	*Base
	Holder      *Holder
	StructField reflect.StructField
}

func (*Field) ID

func (f *Field) ID() string

func (*Field) String added in v1.5.11

func (f *Field) String() string

type Holder

type Holder struct {
	*Base
	Meta    *Meta
	IsEmbed bool
	Holder  *Holder
}

func NewEmbedHolder

func NewEmbedHolder(base *Base, holder *Holder) *Holder

func NewHolder

func NewHolder(m *Meta) *Holder

func (*Holder) ID

func (s *Holder) ID() string

func (*Holder) Stack

func (s *Holder) Stack() string

func (*Holder) String added in v1.5.11

func (s *Holder) String() string

func (*Holder) Walk

func (s *Holder) Walk(f func(source *Holder) error) error

type Interceptor

type Interceptor = func(name string, m *Meta) error

type Meta

type Meta struct {
	*Base
	ProxyMeta *Meta

	Raw    interface{}
	Fields []*Field

	Dependent []*Meta
	// contains filtered or unexported fields
}

func CreateProxy

func CreateProxy(origin *Meta, name string, newComponent any, interceptors ...Interceptor) (*Meta, error)

func NewMeta

func NewMeta(c any) *Meta

func (*Meta) GetAllProperties

func (m *Meta) GetAllProperties() []*Property

func (*Meta) GetComponentProperties

func (m *Meta) GetComponentProperties() []*Property

func (*Meta) GetConfigurationProperties

func (m *Meta) GetConfigurationProperties() []*Property

func (*Meta) GetDependents

func (m *Meta) GetDependents() (names []string)

func (*Meta) GetProperties

func (m *Meta) GetProperties(t PropertyType) []*Property

func (*Meta) ID

func (m *Meta) ID() string

func (*Meta) IsAlias

func (m *Meta) IsAlias() bool

func (*Meta) IsSelf

func (m *Meta) IsSelf(o *Meta) bool

func (*Meta) IsSingleton

func (m *Meta) IsSingleton() bool

func (*Meta) Name

func (m *Meta) Name() string

func (*Meta) SetName

func (m *Meta) SetName(name string)

func (*Meta) SetProperties

func (m *Meta) SetProperties(properties ...*Property)

func (*Meta) String added in v1.5.11

func (m *Meta) String() string

func (*Meta) UseProxy

func (m *Meta) UseProxy(origin any)

type Property

type Property struct {
	*Field
	PropertyType   PropertyType
	Tag, TagStr    string
	TagVal         string
	Injects        []*Meta
	Configurations map[string]any
	// contains filtered or unexported fields
}

func NewProperty

func NewProperty(field *Field, propType PropertyType, tag, tagVal string) *Property

func (*Property) AddArg added in v1.5.12

func (n *Property) AddArg(t ArgType, val ...string)

func (*Property) Args

func (n *Property) Args() TagArg

func (*Property) ID

func (n *Property) ID() string

func (*Property) Inject

func (n *Property) Inject(metas []*Meta) error

func (*Property) IsRequired added in v1.5.12

func (n *Property) IsRequired() bool

func (*Property) SetArg

func (n *Property) SetArg(t ArgType, val ...string)

func (*Property) SetConfiguration added in v1.5.7

func (n *Property) SetConfiguration(path string, configValue any)

func (*Property) String

func (n *Property) String() string

func (*Property) Unmarshall added in v1.5.7

func (n *Property) Unmarshall(configValue any) error

type PropertyType

type PropertyType string
const (
	PropertyTypeConfiguration PropertyType = "Configuration"
	PropertyTypeComponent     PropertyType = "Component"
)

type TagArg

type TagArg map[ArgType][]string

func (TagArg) Add added in v1.5.12

func (m TagArg) Add(argType ArgType, val ...string)

func (TagArg) Find

func (m TagArg) Find(argType ArgType) ([]string, bool)

func (TagArg) ForEach added in v1.5.5

func (m TagArg) ForEach(f func(argType ArgType, args []string))

func (TagArg) Has

func (m TagArg) Has(argType ArgType, wants ...string) bool

func (TagArg) Parse

func (m TagArg) Parse(tag string) string

func (TagArg) Set added in v1.5.12

func (m TagArg) Set(argType ArgType, val ...string)

func (TagArg) String added in v1.5.12

func (m TagArg) String() string

Jump to

Keyboard shortcuts

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