component_definition

package
v1.5.11 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 9 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            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) AppendArg

func (n *Property) AppendArg(t ArgType, val []string)

func (*Property) AppendArgs

func (n *Property) AppendArgs(a TagArg)

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) SetArg

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

func (*Property) SetArgs

func (n *Property) SetArgs(a TagArg)

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) 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, want string) bool

func (TagArg) Parse

func (m TagArg) Parse(tag string) (string, TagArg)

Jump to

Keyboard shortcuts

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