injector

package module
v0.0.0-...-0cce6e3 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: MIT Imports: 7 Imported by: 8

README

injector

golang lightweight inject framework use tag and reflect

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("resource not found")
	ErrExists   = errors.New("already exists")
	ErrType     = errors.New("unexpect param type")
)

Errors

Functions

func Bind

func Bind(val interface{}) error

Bind .

func Find

func Find(val interface{})

Find call global injector with Find function

func Get

func Get(key string, val interface{}) bool

Get call global injector with get function

func Register

func Register(key string, val interface{})

Register call global injector with register function

Types

type Injector

type Injector interface {
	Register(name string, service interface{})
	Get(name string, service interface{}) bool
	Find(services interface{}) // get services
	Bind(service interface{}) error
}

Injector injector engine

func New

func New() Injector

New create new injector context

Jump to

Keyboard shortcuts

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