Documentation
¶
Index ¶
- func ToExecutionFilter(v interface{}) *cron.ExecutionFilter
- func ToJob(v interface{}) *cron.Job
- func ToJobExecution(v interface{}) *cron.JobExecution
- func ToJobExecutions(v []interface{}) []*cron.JobExecution
- func ToJobStats(v interface{}) *cron.JobStats
- func ToJobUpdate(v interface{}) *cron.JobUpdate
- func ToJobs(v []interface{}) []*cron.Job
- type DatabaseStorage
- func (s *DatabaseStorage) AcquireLock(ctx context.Context, jobID string, ttl time.Duration) (bool, error)
- func (s *DatabaseStorage) Connect(ctx context.Context) error
- func (s *DatabaseStorage) DeleteExecution(ctx context.Context, id string) error
- func (s *DatabaseStorage) DeleteExecutionsBefore(ctx context.Context, before time.Time) (int64, error)
- func (s *DatabaseStorage) DeleteExecutionsByJob(ctx context.Context, jobID string) (int64, error)
- func (s *DatabaseStorage) DeleteJob(ctx context.Context, id string) error
- func (s *DatabaseStorage) Disconnect(ctx context.Context) error
- func (s *DatabaseStorage) GetExecution(ctx context.Context, id string) (interface{}, error)
- func (s *DatabaseStorage) GetExecutionCount(ctx context.Context, filterInterface interface{}) (int64, error)
- func (s *DatabaseStorage) GetJob(ctx context.Context, id string) (interface{}, error)
- func (s *DatabaseStorage) GetJobStats(ctx context.Context, jobID string) (interface{}, error)
- func (s *DatabaseStorage) ListExecutions(ctx context.Context, filterInterface interface{}) ([]interface{}, error)
- func (s *DatabaseStorage) ListJobs(ctx context.Context) ([]interface{}, error)
- func (s *DatabaseStorage) Ping(ctx context.Context) error
- func (s *DatabaseStorage) RefreshLock(ctx context.Context, jobID string, ttl time.Duration) error
- func (s *DatabaseStorage) ReleaseLock(ctx context.Context, jobID string) error
- func (s *DatabaseStorage) SaveExecution(ctx context.Context, execInterface interface{}) error
- func (s *DatabaseStorage) SaveJob(ctx context.Context, jobInterface interface{}) error
- func (s *DatabaseStorage) UpdateJob(ctx context.Context, id string, updateInterface interface{}) error
- type MemoryStorage
- func (s *MemoryStorage) AcquireLock(ctx context.Context, jobID string, ttl time.Duration) (bool, error)
- func (s *MemoryStorage) Connect(ctx context.Context) error
- func (s *MemoryStorage) DeleteExecution(ctx context.Context, id string) error
- func (s *MemoryStorage) DeleteExecutionsBefore(ctx context.Context, before time.Time) (int64, error)
- func (s *MemoryStorage) DeleteExecutionsByJob(ctx context.Context, jobID string) (int64, error)
- func (s *MemoryStorage) DeleteJob(ctx context.Context, id string) error
- func (s *MemoryStorage) Disconnect(ctx context.Context) error
- func (s *MemoryStorage) GetExecution(ctx context.Context, id string) (interface{}, error)
- func (s *MemoryStorage) GetExecutionCount(ctx context.Context, filterInterface interface{}) (int64, error)
- func (s *MemoryStorage) GetJob(ctx context.Context, id string) (interface{}, error)
- func (s *MemoryStorage) GetJobStats(ctx context.Context, jobID string) (interface{}, error)
- func (s *MemoryStorage) ListExecutions(ctx context.Context, filterInterface interface{}) ([]interface{}, error)
- func (s *MemoryStorage) ListJobs(ctx context.Context) ([]interface{}, error)
- func (s *MemoryStorage) Ping(ctx context.Context) error
- func (s *MemoryStorage) RefreshLock(ctx context.Context, jobID string, ttl time.Duration) error
- func (s *MemoryStorage) ReleaseLock(ctx context.Context, jobID string) error
- func (s *MemoryStorage) SaveExecution(ctx context.Context, execInterface interface{}) error
- func (s *MemoryStorage) SaveJob(ctx context.Context, jobInterface interface{}) error
- func (s *MemoryStorage) UpdateJob(ctx context.Context, id string, updateInterface interface{}) error
- type RedisStorage
- func (s *RedisStorage) AcquireLock(ctx context.Context, jobID string, ttl time.Duration) (bool, error)
- func (s *RedisStorage) Connect(ctx context.Context) error
- func (s *RedisStorage) DeleteExecution(ctx context.Context, id string) error
- func (s *RedisStorage) DeleteExecutionsBefore(ctx context.Context, before time.Time) (int64, error)
- func (s *RedisStorage) DeleteExecutionsByJob(ctx context.Context, jobID string) (int64, error)
- func (s *RedisStorage) DeleteJob(ctx context.Context, id string) error
- func (s *RedisStorage) Disconnect(ctx context.Context) error
- func (s *RedisStorage) GetExecution(ctx context.Context, id string) (interface{}, error)
- func (s *RedisStorage) GetExecutionCount(ctx context.Context, filterInterface interface{}) (int64, error)
- func (s *RedisStorage) GetJob(ctx context.Context, id string) (interface{}, error)
- func (s *RedisStorage) GetJobStats(ctx context.Context, jobID string) (interface{}, error)
- func (s *RedisStorage) ListExecutions(ctx context.Context, filterInterface interface{}) ([]interface{}, error)
- func (s *RedisStorage) ListJobs(ctx context.Context) ([]interface{}, error)
- func (s *RedisStorage) Ping(ctx context.Context) error
- func (s *RedisStorage) RefreshLock(ctx context.Context, jobID string, ttl time.Duration) error
- func (s *RedisStorage) ReleaseLock(ctx context.Context, jobID string) error
- func (s *RedisStorage) SaveExecution(ctx context.Context, execInterface interface{}) error
- func (s *RedisStorage) SaveJob(ctx context.Context, jobInterface interface{}) error
- func (s *RedisStorage) UpdateJob(ctx context.Context, id string, updateInterface interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToExecutionFilter ¶
func ToExecutionFilter(v interface{}) *cron.ExecutionFilter
ToExecutionFilter converts interface{} to *cron.ExecutionFilter
func ToJobExecution ¶
func ToJobExecution(v interface{}) *cron.JobExecution
ToJobExecution converts interface{} to *cron.JobExecution
func ToJobExecutions ¶
func ToJobExecutions(v []interface{}) []*cron.JobExecution
ToJobExecutions converts []interface{} to []*cron.JobExecution
func ToJobStats ¶
ToJobStats converts interface{} to *cron.JobStats
func ToJobUpdate ¶
ToJobUpdate converts interface{} to *cron.JobUpdate
Types ¶
type DatabaseStorage ¶
type DatabaseStorage struct {
}
DatabaseStorage implements Storage using the database extension. This is a placeholder implementation that needs to be completed.
func NewDatabaseStorage ¶
func NewDatabaseStorage() *DatabaseStorage
NewDatabaseStorage creates a new database storage. TODO: Implement full database storage with SQL/MongoDB support.
func (*DatabaseStorage) AcquireLock ¶
func (s *DatabaseStorage) AcquireLock(ctx context.Context, jobID string, ttl time.Duration) (bool, error)
AcquireLock is not supported for database storage.
func (*DatabaseStorage) Connect ¶
func (s *DatabaseStorage) Connect(ctx context.Context) error
Connect initializes the database connection.
func (*DatabaseStorage) DeleteExecution ¶
func (s *DatabaseStorage) DeleteExecution(ctx context.Context, id string) error
DeleteExecution removes an execution from the database.
func (*DatabaseStorage) DeleteExecutionsBefore ¶
func (s *DatabaseStorage) DeleteExecutionsBefore(ctx context.Context, before time.Time) (int64, error)
DeleteExecutionsBefore removes old executions from the database.
func (*DatabaseStorage) DeleteExecutionsByJob ¶
DeleteExecutionsByJob removes executions for a job from the database.
func (*DatabaseStorage) DeleteJob ¶
func (s *DatabaseStorage) DeleteJob(ctx context.Context, id string) error
DeleteJob removes a job from the database.
func (*DatabaseStorage) Disconnect ¶
func (s *DatabaseStorage) Disconnect(ctx context.Context) error
Disconnect closes the database connection.
func (*DatabaseStorage) GetExecution ¶
func (s *DatabaseStorage) GetExecution(ctx context.Context, id string) (interface{}, error)
GetExecution retrieves an execution from the database.
func (*DatabaseStorage) GetExecutionCount ¶
func (s *DatabaseStorage) GetExecutionCount(ctx context.Context, filterInterface interface{}) (int64, error)
GetExecutionCount counts executions in the database.
func (*DatabaseStorage) GetJob ¶
func (s *DatabaseStorage) GetJob(ctx context.Context, id string) (interface{}, error)
GetJob retrieves a job from the database.
func (*DatabaseStorage) GetJobStats ¶
func (s *DatabaseStorage) GetJobStats(ctx context.Context, jobID string) (interface{}, error)
GetJobStats calculates job statistics from the database.
func (*DatabaseStorage) ListExecutions ¶
func (s *DatabaseStorage) ListExecutions(ctx context.Context, filterInterface interface{}) ([]interface{}, error)
ListExecutions retrieves executions from the database.
func (*DatabaseStorage) ListJobs ¶
func (s *DatabaseStorage) ListJobs(ctx context.Context) ([]interface{}, error)
ListJobs retrieves all jobs from the database.
func (*DatabaseStorage) Ping ¶
func (s *DatabaseStorage) Ping(ctx context.Context) error
Ping checks database connectivity.
func (*DatabaseStorage) RefreshLock ¶
RefreshLock is not supported for database storage.
func (*DatabaseStorage) ReleaseLock ¶
func (s *DatabaseStorage) ReleaseLock(ctx context.Context, jobID string) error
ReleaseLock is not supported for database storage.
func (*DatabaseStorage) SaveExecution ¶
func (s *DatabaseStorage) SaveExecution(ctx context.Context, execInterface interface{}) error
SaveExecution saves an execution to the database.
type MemoryStorage ¶
type MemoryStorage struct {
// contains filtered or unexported fields
}
MemoryStorage implements Storage using in-memory maps. This implementation is suitable for development and testing but does not persist data.
func NewMemoryStorage ¶
func NewMemoryStorage() *MemoryStorage
NewMemoryStorage creates a new in-memory storage.
func (*MemoryStorage) AcquireLock ¶
func (s *MemoryStorage) AcquireLock(ctx context.Context, jobID string, ttl time.Duration) (bool, error)
AcquireLock attempts to acquire a distributed lock. For memory storage, this is a simple mutex-based implementation.
func (*MemoryStorage) Connect ¶
func (s *MemoryStorage) Connect(ctx context.Context) error
Connect initializes the storage (no-op for memory).
func (*MemoryStorage) DeleteExecution ¶
func (s *MemoryStorage) DeleteExecution(ctx context.Context, id string) error
DeleteExecution removes an execution.
func (*MemoryStorage) DeleteExecutionsBefore ¶
func (s *MemoryStorage) DeleteExecutionsBefore(ctx context.Context, before time.Time) (int64, error)
DeleteExecutionsBefore removes executions older than the given time.
func (*MemoryStorage) DeleteExecutionsByJob ¶
DeleteExecutionsByJob removes all executions for a job.
func (*MemoryStorage) DeleteJob ¶
func (s *MemoryStorage) DeleteJob(ctx context.Context, id string) error
DeleteJob removes a job.
func (*MemoryStorage) Disconnect ¶
func (s *MemoryStorage) Disconnect(ctx context.Context) error
Disconnect closes the storage (no-op for memory).
func (*MemoryStorage) GetExecution ¶
func (s *MemoryStorage) GetExecution(ctx context.Context, id string) (interface{}, error)
GetExecution retrieves an execution by ID.
func (*MemoryStorage) GetExecutionCount ¶
func (s *MemoryStorage) GetExecutionCount(ctx context.Context, filterInterface interface{}) (int64, error)
GetExecutionCount returns the number of executions matching the filter.
func (*MemoryStorage) GetJob ¶
func (s *MemoryStorage) GetJob(ctx context.Context, id string) (interface{}, error)
GetJob retrieves a job by ID.
func (*MemoryStorage) GetJobStats ¶
func (s *MemoryStorage) GetJobStats(ctx context.Context, jobID string) (interface{}, error)
GetJobStats calculates statistics for a job.
func (*MemoryStorage) ListExecutions ¶
func (s *MemoryStorage) ListExecutions(ctx context.Context, filterInterface interface{}) ([]interface{}, error)
ListExecutions retrieves executions matching the filter.
func (*MemoryStorage) ListJobs ¶
func (s *MemoryStorage) ListJobs(ctx context.Context) ([]interface{}, error)
ListJobs retrieves all jobs.
func (*MemoryStorage) Ping ¶
func (s *MemoryStorage) Ping(ctx context.Context) error
Ping checks if the storage is available.
func (*MemoryStorage) RefreshLock ¶
RefreshLock extends the TTL of an existing lock.
func (*MemoryStorage) ReleaseLock ¶
func (s *MemoryStorage) ReleaseLock(ctx context.Context, jobID string) error
ReleaseLock releases a distributed lock.
func (*MemoryStorage) SaveExecution ¶
func (s *MemoryStorage) SaveExecution(ctx context.Context, execInterface interface{}) error
SaveExecution saves a job execution.
type RedisStorage ¶
type RedisStorage struct {
}
RedisStorage implements Storage using Redis. This is a placeholder implementation that needs to be completed.
func NewRedisStorage ¶
func NewRedisStorage() *RedisStorage
NewRedisStorage creates a new Redis storage. TODO: Implement full Redis storage with connection pool and distributed locks.
func (*RedisStorage) AcquireLock ¶
func (s *RedisStorage) AcquireLock(ctx context.Context, jobID string, ttl time.Duration) (bool, error)
AcquireLock acquires a distributed lock using Redis.
func (*RedisStorage) Connect ¶
func (s *RedisStorage) Connect(ctx context.Context) error
Connect initializes the Redis connection.
func (*RedisStorage) DeleteExecution ¶
func (s *RedisStorage) DeleteExecution(ctx context.Context, id string) error
DeleteExecution removes an execution from Redis.
func (*RedisStorage) DeleteExecutionsBefore ¶
DeleteExecutionsBefore removes old executions from Redis.
func (*RedisStorage) DeleteExecutionsByJob ¶
DeleteExecutionsByJob removes executions for a job from Redis.
func (*RedisStorage) DeleteJob ¶
func (s *RedisStorage) DeleteJob(ctx context.Context, id string) error
DeleteJob removes a job from Redis.
func (*RedisStorage) Disconnect ¶
func (s *RedisStorage) Disconnect(ctx context.Context) error
Disconnect closes the Redis connection.
func (*RedisStorage) GetExecution ¶
func (s *RedisStorage) GetExecution(ctx context.Context, id string) (interface{}, error)
GetExecution retrieves an execution from Redis.
func (*RedisStorage) GetExecutionCount ¶
func (s *RedisStorage) GetExecutionCount(ctx context.Context, filterInterface interface{}) (int64, error)
GetExecutionCount counts executions in Redis.
func (*RedisStorage) GetJob ¶
func (s *RedisStorage) GetJob(ctx context.Context, id string) (interface{}, error)
GetJob retrieves a job from Redis.
func (*RedisStorage) GetJobStats ¶
func (s *RedisStorage) GetJobStats(ctx context.Context, jobID string) (interface{}, error)
GetJobStats calculates job statistics from Redis.
func (*RedisStorage) ListExecutions ¶
func (s *RedisStorage) ListExecutions(ctx context.Context, filterInterface interface{}) ([]interface{}, error)
ListExecutions retrieves executions from Redis.
func (*RedisStorage) ListJobs ¶
func (s *RedisStorage) ListJobs(ctx context.Context) ([]interface{}, error)
ListJobs retrieves all jobs from Redis.
func (*RedisStorage) Ping ¶
func (s *RedisStorage) Ping(ctx context.Context) error
Ping checks Redis connectivity.
func (*RedisStorage) RefreshLock ¶
RefreshLock extends the TTL of a lock.
func (*RedisStorage) ReleaseLock ¶
func (s *RedisStorage) ReleaseLock(ctx context.Context, jobID string) error
ReleaseLock releases a distributed lock.
func (*RedisStorage) SaveExecution ¶
func (s *RedisStorage) SaveExecution(ctx context.Context, execInterface interface{}) error
SaveExecution saves an execution to Redis.