deps

package
v0.0.0-...-8262c23 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear()

func Get

func Get(ctn interface{}, key string) interface{}

func Inject

func Inject(ctn interface{}, objs ...interface{})

func NewContext

func NewContext(ctx context.Context, container Container) context.Context

NewContext returns a new Context, derived from ctx, which carries the provided Container.

func Register

func Register(def Definition)

Register the provided Definition to be available when building the DI container.

func SafeInject

func SafeInject(ctn interface{}, objs ...interface{})

func Set

func Set(key string, value interface{})

Sets the provided object for the DI container.

Types

type Container

type Container = di.Container

func Build

func Build() Container

func C

func C(i interface{}) Container

func FromContext

func FromContext(ctx context.Context) Container

FromContext returns a Container from ctx or panic if no Container is found.

type Definition

type Definition = di.Def

type DepsInjector

type DepsInjector interface {
	InjectDeps(ctn Container)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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