Documentation ¶
Index ¶
- Variables
- func AddScopedIBackgroundTasks(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddScopedIBackgroundTasksByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddScopedIJobsProvider(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddScopedIJobsProviderByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonIBackgroundTasks(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddSingletonIBackgroundTasksByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonIBackgroundTasksByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)
- func AddSingletonIJobsProvider(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddSingletonIJobsProviderByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonIJobsProviderByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)
- func AddTransientIBackgroundTasks(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddTransientIBackgroundTasksByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddTransientIJobsProvider(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddTransientIJobsProviderByFunc(builder *di.Builder, implType reflect.Type, ...)
- func RemoveAllIBackgroundTasks(builder *di.Builder)
- func RemoveAllIJobsProvider(builder *di.Builder)
- type IBackgroundTasks
- func GetIBackgroundTasksFromContainer(ctn di.Container) IBackgroundTasks
- func GetManyIBackgroundTasksFromContainer(ctn di.Container) []IBackgroundTasks
- func SafeGetIBackgroundTasksFromContainer(ctn di.Container) (IBackgroundTasks, error)
- func SafeGetManyIBackgroundTasksFromContainer(ctn di.Container) ([]IBackgroundTasks, error)
- type IJobsProvider
- func GetIJobsProviderFromContainer(ctn di.Container) IJobsProvider
- func GetManyIJobsProviderFromContainer(ctn di.Container) []IJobsProvider
- func SafeGetIJobsProviderFromContainer(ctn di.Container) (IJobsProvider, error)
- func SafeGetManyIJobsProviderFromContainer(ctn di.Container) ([]IJobsProvider, error)
- type OneTimeJob
- type OneTimeJobs
- type ScheduledJob
- type ScheduledJobs
Constants ¶
This section is empty.
Variables ¶
var ReflectTypeIBackgroundTasks = di.GetInterfaceReflectType((*IBackgroundTasks)(nil))
ReflectTypeIBackgroundTasks used when your service claims to implement IBackgroundTasks
var ReflectTypeIJobsProvider = di.GetInterfaceReflectType((*IJobsProvider)(nil))
ReflectTypeIJobsProvider used when your service claims to implement IJobsProvider
Functions ¶
func AddScopedIBackgroundTasks ¶
func AddScopedIBackgroundTasks(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
AddScopedIBackgroundTasks adds a type that implements IBackgroundTasks
func AddScopedIBackgroundTasksByFunc ¶
func AddScopedIBackgroundTasksByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddScopedIBackgroundTasksByFunc adds a type by a custom func
func AddScopedIJobsProvider ¶
func AddScopedIJobsProvider(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
AddScopedIJobsProvider adds a type that implements IJobsProvider
func AddScopedIJobsProviderByFunc ¶
func AddScopedIJobsProviderByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddScopedIJobsProviderByFunc adds a type by a custom func
func AddSingletonIBackgroundTasks ¶
func AddSingletonIBackgroundTasks(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
AddSingletonIBackgroundTasks adds a type that implements IBackgroundTasks
func AddSingletonIBackgroundTasksByFunc ¶
func AddSingletonIBackgroundTasksByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddSingletonIBackgroundTasksByFunc adds a type by a custom func
func AddSingletonIBackgroundTasksByObj ¶
func AddSingletonIBackgroundTasksByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)
AddSingletonIBackgroundTasksByObj adds a prebuilt obj
func AddSingletonIJobsProvider ¶
func AddSingletonIJobsProvider(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
AddSingletonIJobsProvider adds a type that implements IJobsProvider
func AddSingletonIJobsProviderByFunc ¶
func AddSingletonIJobsProviderByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddSingletonIJobsProviderByFunc adds a type by a custom func
func AddSingletonIJobsProviderByObj ¶
func AddSingletonIJobsProviderByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)
AddSingletonIJobsProviderByObj adds a prebuilt obj
func AddTransientIBackgroundTasks ¶
func AddTransientIBackgroundTasks(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
AddTransientIBackgroundTasks adds a type that implements IBackgroundTasks
func AddTransientIBackgroundTasksByFunc ¶
func AddTransientIBackgroundTasksByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddTransientIBackgroundTasksByFunc adds a type by a custom func
func AddTransientIJobsProvider ¶
func AddTransientIJobsProvider(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
AddTransientIJobsProvider adds a type that implements IJobsProvider
func AddTransientIJobsProviderByFunc ¶
func AddTransientIJobsProviderByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddTransientIJobsProviderByFunc adds a type by a custom func
func RemoveAllIBackgroundTasks ¶ added in v0.1.144
RemoveAllIBackgroundTasks removes all IBackgroundTasks from the DI
func RemoveAllIJobsProvider ¶ added in v0.1.144
RemoveAllIJobsProvider removes all IJobsProvider from the DI
Types ¶
type IBackgroundTasks ¶
type IBackgroundTasks interface { }
IBackgroundTasks ...
func GetIBackgroundTasksFromContainer ¶
func GetIBackgroundTasksFromContainer(ctn di.Container) IBackgroundTasks
GetIBackgroundTasksFromContainer alternative to SafeGetIBackgroundTasksFromContainer but panics of object is not present
func GetManyIBackgroundTasksFromContainer ¶ added in v0.1.178
func GetManyIBackgroundTasksFromContainer(ctn di.Container) []IBackgroundTasks
GetManyIBackgroundTasksFromContainer alternative to SafeGetManyIBackgroundTasksFromContainer but panics of object is not present
func SafeGetIBackgroundTasksFromContainer ¶
func SafeGetIBackgroundTasksFromContainer(ctn di.Container) (IBackgroundTasks, error)
SafeGetIBackgroundTasksFromContainer trys to get the object by type, will not panic, returns nil and error
func SafeGetManyIBackgroundTasksFromContainer ¶ added in v0.1.178
func SafeGetManyIBackgroundTasksFromContainer(ctn di.Container) ([]IBackgroundTasks, error)
SafeGetManyIBackgroundTasksFromContainer trys to get the object by type, will not panic, returns nil and error
type IJobsProvider ¶
type IJobsProvider interface { GetScheduledJobs() ScheduledJobs GetOneTimeJobs() OneTimeJobs }
IJobsProvider ...
func GetIJobsProviderFromContainer ¶
func GetIJobsProviderFromContainer(ctn di.Container) IJobsProvider
GetIJobsProviderFromContainer alternative to SafeGetIJobsProviderFromContainer but panics of object is not present
func GetManyIJobsProviderFromContainer ¶ added in v0.1.178
func GetManyIJobsProviderFromContainer(ctn di.Container) []IJobsProvider
GetManyIJobsProviderFromContainer alternative to SafeGetManyIJobsProviderFromContainer but panics of object is not present
func SafeGetIJobsProviderFromContainer ¶
func SafeGetIJobsProviderFromContainer(ctn di.Container) (IJobsProvider, error)
SafeGetIJobsProviderFromContainer trys to get the object by type, will not panic, returns nil and error
func SafeGetManyIJobsProviderFromContainer ¶ added in v0.1.178
func SafeGetManyIJobsProviderFromContainer(ctn di.Container) ([]IJobsProvider, error)
SafeGetManyIJobsProviderFromContainer trys to get the object by type, will not panic, returns nil and error
type OneTimeJob ¶
OneTimeJob type
type ScheduledJob ¶
type ScheduledJob struct { // Job must support Run() func Job cron.Job // Schedule "* */5 * * * *","@every 1h30m10s","@midnight" Schedule string }
ScheduledJob cron