meta

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetComponentName

func GetComponentName(t any) (id, alias string)

Types

type ArgType added in v1.4.0

type ArgType string
const (
	ArgRequired  ArgType = "required"
	ArgQualifier ArgType = "qualifier"
)

type Base added in v1.3.6

type Base struct {
	Type  reflect.Type
	Value reflect.Value
}

func NewBase added in v1.3.6

func NewBase(c any) *Base

type Holder added in v1.3.6

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

func NewEmbedHolder added in v1.3.6

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

func NewHolder added in v1.3.6

func NewHolder(m *Meta) *Holder

func (*Holder) ID added in v1.3.6

func (s *Holder) ID() string

func (*Holder) Walk added in v1.3.6

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

type Meta

type Meta struct {
	*Base

	Name    string
	IsAlias bool
	Address uintptr
	Raw     interface{}

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

func NewMeta added in v1.3.6

func NewMeta(c any) *Meta

func (*Meta) GetComponentNodes added in v1.4.0

func (m *Meta) GetComponentNodes() []*Node

func (*Meta) GetConfigurationNodes added in v1.4.0

func (m *Meta) GetConfigurationNodes() []*Node

func (*Meta) GetNodes added in v1.4.0

func (m *Meta) GetNodes(t NodeType) []*Node

func (*Meta) ID

func (m *Meta) ID() string

func (*Meta) SetNodes added in v1.4.0

func (m *Meta) SetNodes(t NodeType, nodes ...*Node)

func (*Meta) TypeID added in v1.3.6

func (m *Meta) TypeID() string

type Node

type Node struct {
	*Base
	Holder  *Holder
	Field   reflect.StructField
	Tag     string
	TagVal  string
	Injects []*Meta
	// contains filtered or unexported fields
}

func NewNode added in v1.3.6

func NewNode(base *Base, holder *Holder, field reflect.StructField, tag, tagVal string) *Node

func (*Node) Args added in v1.4.0

func (n *Node) Args() TagArg

func (*Node) ID added in v1.3.6

func (n *Node) ID() string

func (*Node) Inject

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

type NodeType added in v1.4.0

type NodeType string
const (
	NodeTypeConfiguration NodeType = "configuration"
	NodeTypeComponent     NodeType = "component"
)

type TagArg added in v1.4.0

type TagArg map[ArgType][]string

func (TagArg) Find added in v1.4.0

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

func (TagArg) Has added in v1.4.0

func (m TagArg) Has(argType ArgType, want string) bool

func (TagArg) Parse added in v1.4.0

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