utils

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyBound                 = errors.New("dependency already bound")
	ErrImpossibleIdentifyType       = errors.New("impossible to identify the given type")
	ErrElementNotRegistered         = errors.New("element with given key is not registered")
	ErrNoElementFoundInsideOrParent = errors.New(
		"no element found on the given injector or any of it's parents",
	)
	ErrCycleDependencyDetected = errors.New("cycle dependency detected, check for it")
	ErrOverrideInRuntime       = errors.New(
		"a process tried to override a value during runtime",
	)
	ErrTypeCastInRuntime       = errors.New("unable to find/cast the element with given type")
	ErrFoundMoreThanOneValidDI = errors.New("found more than one element that fits the given type")
)

Functions

func GetElemKey

func GetElemKey(element any, options injopts.KeyGenOption) types.BindKey

func GetElemType

func GetElemType[T any](element T) (foundType reflect.Type, isInterface bool)

func GetKey

func GetKey[T any](options injopts.KeyGenOption) types.BindKey

func GetType

func GetType[T any]() (foundType reflect.Type, isInterface bool)

func TypeNameByReflection added in v1.8.0

func TypeNameByReflection[T any](generifyInterface, identifyPointer bool, elements ...T) string

TypeNameByReflection returns a string that defines the name of the given generic type.

Types

This section is empty.

Jump to

Keyboard shortcuts

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