Versions in this module Expand all Collapse all v0 v0.3.2 Apr 27, 2024 v0.3.0 May 28, 2023 Changes in this version + func Enqueue(appName string, argument interface{}, queue string, redisStorage *RedisStorage) (uuid.UUID, error) + func StartServer(sqlStorage SqlStorage, config *Configuration) error + type Application struct + BaseDirectory string + LauncherApp *string + Name string + type Argument struct + Name string + Type string + Value string + type BackgroundJob struct + CompletedAt *time.Time + CreatedAt time.Time + Error *JobError + Id uuid.UUID + Job *Job + JobError *string + JobId uuid.UUID + JobLogs []*JobLog + LastActivity *time.Time + Logs *string + ProcessedBy *uuid.UUID + Server string + StartedAt *time.Time + Status JobStatus + type Configuration struct + Applications []*Application + CleanStorageInterval int + ConnectionRetries int + ConnectionRetryInterval int + EnableDeleteAll bool + EnableStopServers bool + InactiveJobTimeout int + InactiveLockTimeout int + InactiveServerTimeout int + JobHeartbeatInterval int + LockHeartbeatInterval int + LongTermStorageConfig string + LongTermStorageType LongTermStorageType + OffDays []time.Weekday + ServerHeartbeatInterval int + Servers []*Server + StorageConfig string + StorageExpirationInDays int + StorageSyncBatchSize int + StorageSyncInterval int + StorageType StorageType + func LoadConfiguration(configPath *string) *Configuration + type DistributedLock struct + Id string + Key string + LastActivity time.Time + StartedAt time.Time + func NewDistributedLock(key string, start bool, redisStorage *RedisStorage) *DistributedLock + func (distLock *DistributedLock) Enter() + func (distLock *DistributedLock) Exit() + func (distLock *DistributedLock) TryEnter() bool + func (distLock *DistributedLock) TryEnterTill(timeout time.Duration) bool + func (distLock *DistributedLock) TryEnterTillMS(millisecondsTimeout int) bool + type Job struct + Active bool + AfterBackgroundJobIds *string + AppName string + Argument *string + BackgroundJobs []*BackgroundJob + CreatedAt time.Time + Id uuid.UUID + IsRecurring bool + JobArgument *JobArgument + Name *string + Queue string + Recurring *string + RecurringPattern *recur.RecurringPattern + StartAt *time.Time + Tries int + Type JobType + func EnqueueAfter(appName string, argument interface{}, bgJobId uuid.UUID, queue string, ...) (*Job, error) + func NewJob(appName string, argument interface{}, startAt *time.Time, ...) *Job + func Schedule(appName string, argument interface{}, startAt time.Time, queue string, ...) (*Job, error) + func Subscribe(appName string, argument interface{}, recurPattern recur.RecurringPattern, ...) (*Job, error) + func (job *Job) Enqueue(redisStorage *RedisStorage) (uuid.UUID, error) + type JobArgument struct + Arguments []*Argument + Assembly string + ClassType string + IsStatic bool + MetadataToken int + MethodName string + type JobError struct + InnerError *JobError + Message string + StackTrace *string + func NewJobError(message string) *JobError + type JobLog struct + CpuUsage float64 + MemoryUsage float64 + Time time.Time + type JobStatus uint8 + const Canceled + const Enqueued + const Failed + const Interrupted + const Processed + const Processing + const Scheduled + func (status JobStatus) String() string + type JobType uint8 + const Microservice + const Thread + type LongTermStorageType uint8 + const MySql + const Oracle + const PostgresSQL + const SqlServer + type PassArgumentType uint8 + const Base64 + const JobId + type Queue struct + Name string + Retries int + RetryInterval int + WorkersCount int + func (queue *Queue) StartJob(bgJobId uuid.UUID, server *Server, redisStorage *RedisStorage) + type RedisStorage struct + Config *Configuration + func Connect(config *Configuration) (*RedisStorage, error) + func (redisStorage *RedisStorage) AddJobLog(BackgroundJobId uuid.UUID, log *JobLog) + func (redisStorage *RedisStorage) DeleteBackgroundJob(bgJob *BackgroundJob) + func (redisStorage *RedisStorage) DeleteBackgroundJobs(bgJobs []*BackgroundJob) + func (redisStorage *RedisStorage) DeleteDistributedLock(key string, id string) + func (redisStorage *RedisStorage) DeleteExpired() error + func (redisStorage *RedisStorage) DeleteJob(job *Job) + func (redisStorage *RedisStorage) Dequeue(queue string) uuid.UUID + func (redisStorage *RedisStorage) DistributedLocksCount(key string) int64 + func (redisStorage *RedisStorage) EnqueueAfter(jobId uuid.UUID, bgJobId uuid.UUID) error + func (redisStorage *RedisStorage) GetAllDistributedLocks() []*DistributedLock + func (redisStorage *RedisStorage) GetAllJobs(status JobStatus) ([]*BackgroundJob, int) + func (redisStorage *RedisStorage) GetBackgroundJob(backgroundJobId uuid.UUID, includeDetails bool) *BackgroundJob + func (redisStorage *RedisStorage) GetJob(jobId uuid.UUID, loadLatest bool) *Job + func (redisStorage *RedisStorage) GetJobLogs(backgroundJobId uuid.UUID) []*JobLog + func (redisStorage *RedisStorage) GetJobs(serverId uuid.UUID, queue string) []*Job + func (redisStorage *RedisStorage) GetServer(server *Server) + func (redisStorage *RedisStorage) GetServerJobs(serverId uuid.UUID, queue string) []*BackgroundJob + func (redisStorage *RedisStorage) HasRunningJobs(serverId uuid.UUID) bool + func (redisStorage *RedisStorage) IsDistributedLockEntered(key string, id string) bool + func (redisStorage *RedisStorage) JobEnqueued(jobId uuid.UUID, queue string) + func (redisStorage *RedisStorage) SaveBackgroundJob(bgJob *BackgroundJob) error + func (redisStorage *RedisStorage) SaveDistributedLock(distLock *DistributedLock) + func (redisStorage *RedisStorage) SaveJob(job *Job, forceUpdate bool) error + func (redisStorage *RedisStorage) SaveServer(server *Server) + func (redisStorage *RedisStorage) ScheduleChanged(serverId uuid.UUID, queue string) bool + type Server struct + HasDataSync bool + Hostname string + Id uuid.UUID + LastActivity time.Time + Queues []*Queue + StartedAt time.Time + Status ServerStatus + WorkersCount int + func (server *Server) StartService(redisStorage *RedisStorage, sqlStorage SqlStorage) + type ServerStatus uint8 + const Running + const Stopped + type SqlStorage interface + Connect func(config *Configuration) error + DeleteExpired func() error + SaveBackgroundJobs func(bgJobs []*BackgroundJob) error + type StorageType uint8 + const Redis