backgroundtasks

package
v0.1.316-herb-SECURITY.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReflectTypeIBackgroundTasks = di.GetInterfaceReflectType((*IBackgroundTasks)(nil))

ReflectTypeIBackgroundTasks used when your service claims to implement IBackgroundTasks

View Source
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 AddScopedIBackgroundTasksByFuncWithMetadata added in v0.1.217

func AddScopedIBackgroundTasksByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddScopedIBackgroundTasksByFuncWithMetadata adds a type by a custom func

func AddScopedIBackgroundTasksWithMetadata added in v0.1.217

func AddScopedIBackgroundTasksWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddScopedIBackgroundTasksWithMetadata adds a type that implements IBackgroundTasks

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 AddScopedIJobsProviderByFuncWithMetadata added in v0.1.217

func AddScopedIJobsProviderByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddScopedIJobsProviderByFuncWithMetadata adds a type by a custom func

func AddScopedIJobsProviderWithMetadata added in v0.1.217

func AddScopedIJobsProviderWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddScopedIJobsProviderWithMetadata adds a type that implements IJobsProvider

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 AddSingletonIBackgroundTasksByFuncWithMetadata added in v0.1.217

func AddSingletonIBackgroundTasksByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonIBackgroundTasksByFuncWithMetadata 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 AddSingletonIBackgroundTasksByObjWithMetadata added in v0.1.217

func AddSingletonIBackgroundTasksByObjWithMetadata(builder *di.Builder, obj interface{}, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonIBackgroundTasksByObjWithMetadata adds a prebuilt obj

func AddSingletonIBackgroundTasksWithMetadata added in v0.1.217

func AddSingletonIBackgroundTasksWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonIBackgroundTasksWithMetadata adds a type that implements IBackgroundTasks

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 AddSingletonIJobsProviderByFuncWithMetadata added in v0.1.217

func AddSingletonIJobsProviderByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonIJobsProviderByFuncWithMetadata 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 AddSingletonIJobsProviderByObjWithMetadata added in v0.1.217

func AddSingletonIJobsProviderByObjWithMetadata(builder *di.Builder, obj interface{}, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonIJobsProviderByObjWithMetadata adds a prebuilt obj

func AddSingletonIJobsProviderWithMetadata added in v0.1.217

func AddSingletonIJobsProviderWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonIJobsProviderWithMetadata adds a type that implements IJobsProvider

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 AddTransientIBackgroundTasksByFuncWithMetadata added in v0.1.217

func AddTransientIBackgroundTasksByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddTransientIBackgroundTasksByFuncWithMetadata adds a type by a custom func

func AddTransientIBackgroundTasksWithMetadata added in v0.1.217

func AddTransientIBackgroundTasksWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddTransientIBackgroundTasksWithMetadata adds a type that implements IBackgroundTasks

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 AddTransientIJobsProviderByFuncWithMetadata added in v0.1.217

func AddTransientIJobsProviderByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddTransientIJobsProviderByFuncWithMetadata adds a type by a custom func

func AddTransientIJobsProviderWithMetadata added in v0.1.217

func AddTransientIJobsProviderWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddTransientIJobsProviderWithMetadata adds a type that implements IJobsProvider

func GetIBackgroundTasksDefinition added in v0.1.217

func GetIBackgroundTasksDefinition(ctn di.Container) *di.Def

GetIBackgroundTasksDefinition returns that last definition registered that this container can provide

func GetIBackgroundTasksDefinitions added in v0.1.217

func GetIBackgroundTasksDefinitions(ctn di.Container) []*di.Def

GetIBackgroundTasksDefinitions returns all definitions that this container can provide

func GetIJobsProviderDefinition added in v0.1.217

func GetIJobsProviderDefinition(ctn di.Container) *di.Def

GetIJobsProviderDefinition returns that last definition registered that this container can provide

func GetIJobsProviderDefinitions added in v0.1.217

func GetIJobsProviderDefinitions(ctn di.Container) []*di.Def

GetIJobsProviderDefinitions returns all definitions that this container can provide

func RemoveAllIBackgroundTasks added in v0.1.144

func RemoveAllIBackgroundTasks(builder *di.Builder)

RemoveAllIBackgroundTasks removes all IBackgroundTasks from the DI

func RemoveAllIJobsProvider added in v0.1.144

func RemoveAllIJobsProvider(builder *di.Builder)

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

type OneTimeJob struct {
	// Job must support Run() func
	Job   cron.Job
	Delay time.Duration
}

OneTimeJob type

type OneTimeJobs

type OneTimeJobs []*OneTimeJob

OneTimeJobs list

type ScheduledJob

type ScheduledJob struct {
	// Job must support Run() func
	Job cron.Job
	// Schedule "* */5 * * * *","@every 1h30m10s","@midnight"
	Schedule string
}

ScheduledJob cron

type ScheduledJobs

type ScheduledJobs []*ScheduledJob

ScheduledJobs list

Jump to

Keyboard shortcuts

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