inject

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNamed

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

func GetTyped

func GetTyped(refType reflect.Type) (interface{}, bool)

func Inject

func Inject(r ValueResolver, obj interface{}) error

func RegisterNamed

func RegisterNamed(name string, obj interface{}) error

func RegisterTyped

func RegisterTyped(refType reflect.Type, obj interface{}) error

Types

type ConfigResolver added in v1.3.1

type ConfigResolver struct {
	C config.Config
}

func (*ConfigResolver) Resolve added in v1.3.1

func (r *ConfigResolver) Resolve(key string) (interface{}, bool)

type Initializable

type Initializable interface {
	// run after properties set
	Init()
}

type NopValueResolver added in v1.3.1

type NopValueResolver struct{}

func (*NopValueResolver) Resolve added in v1.3.1

func (*NopValueResolver) Resolve(string) (interface{}, bool)

type ValueResolver

type ValueResolver interface {
	Resolve(string) (interface{}, bool)
}

Jump to

Keyboard shortcuts

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