Documentation ¶
Index ¶
- Variables
- func AddScopedILogger(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddScopedILoggerByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddScopedILoggerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, ...)
- func AddScopedILoggerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, ...)
- func AddScopedISingletonLogger(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddScopedISingletonLoggerByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddScopedISingletonLoggerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, ...)
- func AddScopedISingletonLoggerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, ...)
- func AddSingletonILogger(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddSingletonILoggerByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonILoggerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonILoggerByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)
- func AddSingletonILoggerByObjWithMetadata(builder *di.Builder, obj interface{}, metaData map[string]interface{}, ...)
- func AddSingletonILoggerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, ...)
- func AddSingletonISingletonLogger(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddSingletonISingletonLoggerByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonISingletonLoggerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonISingletonLoggerByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)
- func AddSingletonISingletonLoggerByObjWithMetadata(builder *di.Builder, obj interface{}, metaData map[string]interface{}, ...)
- func AddSingletonISingletonLoggerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, ...)
- func AddTransientILogger(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddTransientILoggerByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddTransientILoggerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, ...)
- func AddTransientILoggerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, ...)
- func AddTransientISingletonLogger(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddTransientISingletonLoggerByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddTransientISingletonLoggerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, ...)
- func AddTransientISingletonLoggerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, ...)
- func GetILoggerDefinition(ctn di.Container) *di.Def
- func GetILoggerDefinitions(ctn di.Container) []*di.Def
- func GetISingletonLoggerDefinition(ctn di.Container) *di.Def
- func GetISingletonLoggerDefinitions(ctn di.Container) []*di.Def
- func RemoveAllILogger(builder *di.Builder)
- func RemoveAllISingletonLogger(builder *di.Builder)
- type ILogger
- type ISingletonLogger
- func GetISingletonLoggerFromContainer(ctn di.Container) ISingletonLogger
- func GetManyISingletonLoggerFromContainer(ctn di.Container) []ISingletonLogger
- func SafeGetISingletonLoggerFromContainer(ctn di.Container) (ISingletonLogger, error)
- func SafeGetManyISingletonLoggerFromContainer(ctn di.Container) ([]ISingletonLogger, error)
Constants ¶
This section is empty.
Variables ¶
var ReflectTypeILogger = di.GetInterfaceReflectType((*ILogger)(nil))
ReflectTypeILogger used when your service claims to implement ILogger
var ReflectTypeISingletonLogger = di.GetInterfaceReflectType((*ISingletonLogger)(nil))
ReflectTypeISingletonLogger used when your service claims to implement ISingletonLogger
Functions ¶
func AddScopedILogger ¶
AddScopedILogger adds a type that implements ILogger
func AddScopedILoggerByFunc ¶
func AddScopedILoggerByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddScopedILoggerByFunc adds a type by a custom func
func AddScopedILoggerByFuncWithMetadata ¶ added in v0.1.217
func AddScopedILoggerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddScopedILoggerByFuncWithMetadata adds a type by a custom func
func AddScopedILoggerWithMetadata ¶ added in v0.1.217
func AddScopedILoggerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddScopedILoggerWithMetadata adds a type that implements ILogger
func AddScopedISingletonLogger ¶ added in v0.1.166
func AddScopedISingletonLogger(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
AddScopedISingletonLogger adds a type that implements ISingletonLogger
func AddScopedISingletonLoggerByFunc ¶ added in v0.1.166
func AddScopedISingletonLoggerByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddScopedISingletonLoggerByFunc adds a type by a custom func
func AddScopedISingletonLoggerByFuncWithMetadata ¶ added in v0.1.217
func AddScopedISingletonLoggerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddScopedISingletonLoggerByFuncWithMetadata adds a type by a custom func
func AddScopedISingletonLoggerWithMetadata ¶ added in v0.1.217
func AddScopedISingletonLoggerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddScopedISingletonLoggerWithMetadata adds a type that implements ISingletonLogger
func AddSingletonILogger ¶
func AddSingletonILogger(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
AddSingletonILogger adds a type that implements ILogger
func AddSingletonILoggerByFunc ¶
func AddSingletonILoggerByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddSingletonILoggerByFunc adds a type by a custom func
func AddSingletonILoggerByFuncWithMetadata ¶ added in v0.1.217
func AddSingletonILoggerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddSingletonILoggerByFuncWithMetadata adds a type by a custom func
func AddSingletonILoggerByObj ¶
func AddSingletonILoggerByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)
AddSingletonILoggerByObj adds a prebuilt obj
func AddSingletonILoggerByObjWithMetadata ¶ added in v0.1.217
func AddSingletonILoggerByObjWithMetadata(builder *di.Builder, obj interface{}, metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddSingletonILoggerByObjWithMetadata adds a prebuilt obj
func AddSingletonILoggerWithMetadata ¶ added in v0.1.217
func AddSingletonILoggerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddSingletonILoggerWithMetadata adds a type that implements ILogger
func AddSingletonISingletonLogger ¶ added in v0.1.166
func AddSingletonISingletonLogger(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
AddSingletonISingletonLogger adds a type that implements ISingletonLogger
func AddSingletonISingletonLoggerByFunc ¶ added in v0.1.166
func AddSingletonISingletonLoggerByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddSingletonISingletonLoggerByFunc adds a type by a custom func
func AddSingletonISingletonLoggerByFuncWithMetadata ¶ added in v0.1.217
func AddSingletonISingletonLoggerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddSingletonISingletonLoggerByFuncWithMetadata adds a type by a custom func
func AddSingletonISingletonLoggerByObj ¶ added in v0.1.166
func AddSingletonISingletonLoggerByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)
AddSingletonISingletonLoggerByObj adds a prebuilt obj
func AddSingletonISingletonLoggerByObjWithMetadata ¶ added in v0.1.217
func AddSingletonISingletonLoggerByObjWithMetadata(builder *di.Builder, obj interface{}, metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddSingletonISingletonLoggerByObjWithMetadata adds a prebuilt obj
func AddSingletonISingletonLoggerWithMetadata ¶ added in v0.1.217
func AddSingletonISingletonLoggerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddSingletonISingletonLoggerWithMetadata adds a type that implements ISingletonLogger
func AddTransientILogger ¶
func AddTransientILogger(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
AddTransientILogger adds a type that implements ILogger
func AddTransientILoggerByFunc ¶
func AddTransientILoggerByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddTransientILoggerByFunc adds a type by a custom func
func AddTransientILoggerByFuncWithMetadata ¶ added in v0.1.217
func AddTransientILoggerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddTransientILoggerByFuncWithMetadata adds a type by a custom func
func AddTransientILoggerWithMetadata ¶ added in v0.1.217
func AddTransientILoggerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddTransientILoggerWithMetadata adds a type that implements ILogger
func AddTransientISingletonLogger ¶ added in v0.1.166
func AddTransientISingletonLogger(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
AddTransientISingletonLogger adds a type that implements ISingletonLogger
func AddTransientISingletonLoggerByFunc ¶ added in v0.1.166
func AddTransientISingletonLoggerByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddTransientISingletonLoggerByFunc adds a type by a custom func
func AddTransientISingletonLoggerByFuncWithMetadata ¶ added in v0.1.217
func AddTransientISingletonLoggerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddTransientISingletonLoggerByFuncWithMetadata adds a type by a custom func
func AddTransientISingletonLoggerWithMetadata ¶ added in v0.1.217
func AddTransientISingletonLoggerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddTransientISingletonLoggerWithMetadata adds a type that implements ISingletonLogger
func GetILoggerDefinition ¶ added in v0.1.217
GetILoggerDefinition returns that last definition registered that this container can provide
func GetILoggerDefinitions ¶ added in v0.1.217
GetILoggerDefinitions returns all definitions that this container can provide
func GetISingletonLoggerDefinition ¶ added in v0.1.217
GetISingletonLoggerDefinition returns that last definition registered that this container can provide
func GetISingletonLoggerDefinitions ¶ added in v0.1.217
GetISingletonLoggerDefinitions returns all definitions that this container can provide
func RemoveAllILogger ¶ added in v0.1.144
RemoveAllILogger removes all ILogger from the DI
func RemoveAllISingletonLogger ¶ added in v0.1.166
RemoveAllISingletonLogger removes all ISingletonLogger from the DI
Types ¶
type ILogger ¶
type ILogger interface { Error() *zerolog.Event Debug() *zerolog.Event Fatal() *zerolog.Event Info() *zerolog.Event Warn() *zerolog.Event Trace() *zerolog.Event GetLogger() *zerolog.Logger }
ILogger interface
func GetILoggerFromContainer ¶
GetILoggerFromContainer alternative to SafeGetILoggerFromContainer but panics of object is not present
func GetManyILoggerFromContainer ¶ added in v0.1.178
GetManyILoggerFromContainer alternative to SafeGetManyILoggerFromContainer but panics of object is not present
func SafeGetILoggerFromContainer ¶
SafeGetILoggerFromContainer trys to get the object by type, will not panic, returns nil and error
type ISingletonLogger ¶ added in v0.1.166
type ISingletonLogger interface { ILogger }
ISingletonLogger when you absolutely need a singleton logger
func GetISingletonLoggerFromContainer ¶ added in v0.1.166
func GetISingletonLoggerFromContainer(ctn di.Container) ISingletonLogger
GetISingletonLoggerFromContainer alternative to SafeGetISingletonLoggerFromContainer but panics of object is not present
func GetManyISingletonLoggerFromContainer ¶ added in v0.1.190
func GetManyISingletonLoggerFromContainer(ctn di.Container) []ISingletonLogger
GetManyISingletonLoggerFromContainer alternative to SafeGetManyISingletonLoggerFromContainer but panics of object is not present
func SafeGetISingletonLoggerFromContainer ¶ added in v0.1.166
func SafeGetISingletonLoggerFromContainer(ctn di.Container) (ISingletonLogger, error)
SafeGetISingletonLoggerFromContainer trys to get the object by type, will not panic, returns nil and error
func SafeGetManyISingletonLoggerFromContainer ¶ added in v0.1.190
func SafeGetManyISingletonLoggerFromContainer(ctn di.Container) ([]ISingletonLogger, error)
SafeGetManyISingletonLoggerFromContainer trys to get the object by type, will not panic, returns nil and error