dependency

package
v0.0.0-...-ca95590 Latest Latest
Warning

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

Go to latest
Published: May 16, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDependencyManager   = xerrors.New("error inside dependency manager", "E0510")
	ErrExtractDependencies = ErrDependencyManager.WithMessage("an error occurred while receiving dependencies", "E0511")
	ErrNilArgument         = ErrDependencyManager.WithMessage("nil argument", "E0512")
	ErrNotFunction         = ErrDependencyManager.WithMessage("argument is not a function and cannot be used as a constructor for dependency injection", "E0513")
	ErrVariadicFunction    = ErrDependencyManager.WithMessage("function has a variable number of arguments and cannot be used as a constructor for dependency injection", "E0514")
	ErrNotAllowedTarget    = ErrDependencyManager.WithMessage("target is not allowed for dependency injection", "E0515")
)

Functions

func ExtractDependencies

func ExtractDependencies(env componego.Environment) ([]componego.Dependency, error)

ExtractDependencies returns a list of dependencies from the application and components. This is a raw list without any transformations.

func Get

func Get[T any](env componego.Environment) (T, error)

func GetOrPanic

func GetOrPanic[T any](env componego.Environment) T

func Invoke

func Invoke[T any](fn any, env componego.Environment) (T, error)

func InvokeOrPanic

func InvokeOrPanic[T any](fn any, env componego.Environment) T

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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