inject

package
Version: v1.7.10 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(n string, t reflect.Type)

accept struct pointer only

func Close

func Close()

func Find

func Find(name string) (interface{}, bool)

func FindByType

func FindByType(t reflect.Type) (interface{}, bool)

func Get

func Get(n string) []reflect.Type

func GraphLen

func GraphLen() int

func GraphPrint

func GraphPrint() string

func InitDefault

func InitDefault()

func Reg

func Reg(name string, value interface{}) interface{}

func RegWithoutInjection

func RegWithoutInjection(name string, value interface{}) interface{}

func Register

func Register(name string, value interface{}) (interface{}, error)

func RegisterOrFail

func RegisterOrFail(name string, value interface{}) interface{}

func RegisterOrFailNoFill

func RegisterOrFailNoFill(name string, value interface{}) interface{}

func RegisterOrFailSingle

func RegisterOrFailSingle(name string, value interface{}) interface{}

func RegisterOrFailSingleNoFill

func RegisterOrFailSingleNoFill(name string, value interface{}) interface{}

func RegisterSingle

func RegisterSingle(name string, value interface{}) (interface{}, error)

func SetLogger

func SetLogger(logger Logger)

Types

type CloseAble

type CloseAble interface {
	Close()
}

type Graph

type Graph struct {
	Logger Logger
	// contains filtered or unexported fields
}

func NewGraph

func NewGraph() *Graph

func (*Graph) Close

func (g *Graph) Close()

func (*Graph) Find

func (g *Graph) Find(name string) (*Object, bool)

func (*Graph) FindByType

func (g *Graph) FindByType(t reflect.Type) (*Object, bool)

func (*Graph) Len

func (g *Graph) Len() int

func (*Graph) RegWithoutInjection

func (g *Graph) RegWithoutInjection(name string, value interface{}) interface{}

func (*Graph) Register

func (g *Graph) Register(name string, value interface{}) (interface{}, error)

func (*Graph) RegisterNoFill

func (g *Graph) RegisterNoFill(name string, value interface{}) (interface{}, error)

func (*Graph) RegisterOrFail

func (g *Graph) RegisterOrFail(name string, value interface{}) interface{}

func (*Graph) RegisterOrFailNoFill

func (g *Graph) RegisterOrFailNoFill(name string, value interface{}) interface{}

func (*Graph) RegisterOrFailSingle

func (g *Graph) RegisterOrFailSingle(name string, value interface{}) interface{}

func (*Graph) RegisterOrFailSingleNoFill

func (g *Graph) RegisterOrFailSingleNoFill(name string, value interface{}) interface{}

func (*Graph) RegisterSingle

func (g *Graph) RegisterSingle(name string, value interface{}) (interface{}, error)

func (*Graph) RegisterSingleNoFill

func (g *Graph) RegisterSingleNoFill(name string, value interface{}) (interface{}, error)

func (*Graph) SPrint

func (g *Graph) SPrint() string

type Injectable

type Injectable interface {
	StartAble
	CloseAble
}

type Logger

type Logger interface {
	Debug(format interface{}, v ...interface{})
	Info(format interface{}, v ...interface{})
	Error(format interface{}, v ...interface{}) error
}

type Object

type Object struct {
	Name string

	Value interface{}
	// contains filtered or unexported fields
}

func (Object) String

func (o Object) String() string

type StartAble

type StartAble interface {
	Start() error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL