comm

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bean

type Bean struct {
	// contains filtered or unexported fields
}

func (*Bean) Identical

func (b *Bean) Identical(other *Bean) bool

func (*Bean) Kind

func (b *Bean) Kind() BeanKind

func (*Bean) PkgPath

func (b *Bean) PkgPath() string

func (*Bean) String

func (b *Bean) String() string

type BeanId

type BeanId = string

type BeanKind

type BeanKind int
const (
	BuildInKind BeanKind = iota
	StructKind
	InterfaceKind
	PointerKind
)

type FuncId

type FuncId = string

type Injector

type Injector struct {
	// contains filtered or unexported fields
}

Injector store

func NewInjector

func NewInjector(fn *types.Func, origin map[FuncId]*Provider, buildCall *dst.CallExpr, auto bool) *Injector

NewInjector

func (*Injector) AddProvider

func (inj *Injector) AddProvider(list ...*Provider)

func (*Injector) Package

func (inj *Injector) Package() string

func (*Injector) Require

func (inj *Injector) Require() map[BeanId]*Bean

Require report beans needed to found to complete the injection

if provider P in Injector I provide Bean B, then I does not require B
else if No provider provide B, the injector I require B.

func (*Injector) String

func (inj *Injector) String() string

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

func NewProvider

func NewProvider(fn *types.Func) *Provider

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) Package

func (p *Provider) Package() string

func (*Provider) Provide

func (p *Provider) Provide() *Bean

func (*Provider) Require

func (p *Provider) Require() []*Bean

func (*Provider) String

func (p *Provider) String() string

type WireFile

type WireFile struct {
	// contains filtered or unexported fields
}

func NewFile

func NewFile(dstFile *dst.File, pkg string) *WireFile

func (*WireFile) AddInjector

func (file *WireFile) AddInjector(list ...*Injector)

func (*WireFile) Imports

func (file *WireFile) Imports() []*dst.ImportSpec

func (*WireFile) Package

func (file *WireFile) Package() string

func (*WireFile) Refactor

func (file *WireFile) Refactor()

Jump to

Keyboard shortcuts

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