autowire

package module
v0.0.0-...-5c7b561 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

autowire

实现类可以有个self成员,如果包含这样子的一个成员,则最后一个proxy会有一个clean方法, 该clean,会去设置该self为当前proxy的值

Documentation

Index

Constants

View Source
const (
	MetaWireProvider = "+autowire.Provider"
)

Variables

View Source
var (
	MetaNames = []string{MetaWireProvider}
)
View Source
var TmplWire string

Functions

func DefaultPkgGenFactory

func DefaultPkgGenFactory() meta.PkgGenFactory

func NewFunctions

func NewFunctions(gen *meta.TmplPkgGen) *functions

func Order

func Order(m *meta.Meta) int32

Order It is the injection order,lower values have higher priority(closer it is to the realization).

Types

type ParsedWireResult

type ParsedWireResult struct {
	Providers []types.Object
	Bindings  []*ProviderBinding
}

func (*ParsedWireResult) HasProvider

func (r *ParsedWireResult) HasProvider() bool

type Provider

type Provider struct {
	Order int
}

type ProviderBinding

type ProviderBinding struct {
	OriginIface   types.Type
	Provider      types.Object
	ProviderType  types.Type
	InjectedIface types.Type
	Order         int32
	IsBase        bool
}

type SelfWirer

type SelfWirer interface {
	SetSelf(self any)
}

Jump to

Keyboard shortcuts

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