Documentation ¶
Index ¶
- Variables
- func AddScopedILogger(builder *di.Builder, implType reflect.Type)
- func AddScopedILoggerByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddScopedISingletonLogger(builder *di.Builder, implType reflect.Type)
- func AddScopedISingletonLoggerByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonILogger(builder *di.Builder, implType reflect.Type)
- func AddSingletonILoggerByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonILoggerByObj(builder *di.Builder, obj interface{})
- func AddSingletonISingletonLogger(builder *di.Builder, implType reflect.Type)
- func AddSingletonISingletonLoggerByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonISingletonLoggerByObj(builder *di.Builder, obj interface{})
- func AddTransientILogger(builder *di.Builder, implType reflect.Type)
- func AddTransientILoggerByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddTransientISingletonLogger(builder *di.Builder, implType reflect.Type)
- func AddTransientISingletonLoggerByFunc(builder *di.Builder, implType reflect.Type, ...)
- func RemoveAllILogger(builder *di.Builder)
- func RemoveAllISingletonLogger(builder *di.Builder)
- type ILogger
- type ISingletonLogger
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))
AddScopedILoggerByFunc adds a type by a custom func
func AddScopedISingletonLogger ¶ added in v0.1.166
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))
AddScopedISingletonLoggerByFunc adds a type by a custom func
func AddSingletonILogger ¶
AddSingletonILogger adds a type that implements ILogger
func AddSingletonILoggerByFunc ¶
func AddSingletonILoggerByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error))
AddSingletonILoggerByFunc adds a type by a custom func
func AddSingletonILoggerByObj ¶
AddSingletonILoggerByObj adds a prebuilt obj
func AddSingletonISingletonLogger ¶ added in v0.1.166
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))
AddSingletonISingletonLoggerByFunc adds a type by a custom func
func AddSingletonISingletonLoggerByObj ¶ added in v0.1.166
AddSingletonISingletonLoggerByObj adds a prebuilt obj
func AddTransientILogger ¶
AddTransientILogger adds a type that implements ILogger
func AddTransientILoggerByFunc ¶
func AddTransientILoggerByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error))
AddTransientILoggerByFunc adds a type by a custom func
func AddTransientISingletonLogger ¶ added in v0.1.166
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))
AddTransientISingletonLoggerByFunc adds a type by a custom func
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
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 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