di

package
v0.0.0-...-d8d3109 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Autowire

func Autowire[T any](c *Container, s T) T

func Invoke

func Invoke[T any](c *Container) (T, error)

func InvokeNamed

func InvokeNamed[T any](c *Container, name string) (T, error)

func MustInvoke

func MustInvoke[T any](c *Container) T

func MustInvokeNamed

func MustInvokeNamed[T any](c *Container, name string) T

func ProvideLazy

func ProvideLazy[T any](c *Container, provider Provider, name ...string)

func ProvideNew

func ProvideNew[T any](c *Container, provider Provider, name ...string)

func ProvideValue

func ProvideValue[T any](c *Container, value T, name ...string)

Types

type Container

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

func New

func New() *Container

type Provider

type Provider func(c *Container) (any, error)

Jump to

Keyboard shortcuts

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