redis

package module
v0.0.0-...-9e38f01 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisConfig

type RedisConfig struct {
	Host         string            `json:"host"`
	Port         int               `json:"port"`
	Password     string            `json:"password"`
	Database     int               `json:"database"`
	PoolSize     int               `json:"pool_size"`
	MinIdleConns int               `json:"min_idle_conns"`
	MaxRetries   int               `json:"max_retries"`
	DialTimeout  time.Duration     `json:"dial_timeout"`
	ReadTimeout  time.Duration     `json:"read_timeout"`
	WriteTimeout time.Duration     `json:"write_timeout"`
	Metadata     map[string]string `json:"metadata"`
}

RedisConfig holds Redis-specific configuration

type RedisProvider

type RedisProvider struct {
	// contains filtered or unexported fields
}

RedisProvider implements SchedulingProvider using Redis

func NewRedisProvider

func NewRedisProvider(config *RedisConfig, logger *logrus.Logger) (*RedisProvider, error)

NewRedisProvider creates a new Redis scheduling provider

func (*RedisProvider) CancelMultiple

func (rp *RedisProvider) CancelMultiple(ctx context.Context, taskIDs []string) error

CancelMultiple cancels multiple tasks

func (*RedisProvider) CancelTask

func (rp *RedisProvider) CancelTask(ctx context.Context, taskID string) error

CancelTask cancels a scheduled task

func (*RedisProvider) Connect

func (rp *RedisProvider) Connect(ctx context.Context) error

Connect connects the provider

func (*RedisProvider) Disconnect

func (rp *RedisProvider) Disconnect(ctx context.Context) error

Disconnect disconnects the provider

func (*RedisProvider) GetConnectionInfo

func (rp *RedisProvider) GetConnectionInfo() *types.ConnectionInfo

GetConnectionInfo returns connection information

func (*RedisProvider) GetHealth

func (rp *RedisProvider) GetHealth(ctx context.Context) (*types.HealthStatus, error)

GetHealth returns the health status

func (*RedisProvider) GetMetrics

func (rp *RedisProvider) GetMetrics(ctx context.Context) (*types.Metrics, error)

GetMetrics returns provider metrics

func (*RedisProvider) GetName

func (rp *RedisProvider) GetName() string

GetName returns the provider name

func (*RedisProvider) GetSupportedFeatures

func (rp *RedisProvider) GetSupportedFeatures() []types.SchedulingFeature

GetSupportedFeatures returns supported features

func (*RedisProvider) GetTask

func (rp *RedisProvider) GetTask(ctx context.Context, taskID string) (*types.Task, error)

GetTask retrieves a task by ID

func (*RedisProvider) IsConnected

func (rp *RedisProvider) IsConnected() bool

IsConnected returns connection status

func (*RedisProvider) ListTasks

func (rp *RedisProvider) ListTasks(ctx context.Context, filter *types.TaskFilter) ([]*types.Task, error)

ListTasks lists tasks with optional filtering

func (*RedisProvider) Ping

func (rp *RedisProvider) Ping(ctx context.Context) error

Ping checks if the provider is responsive

func (*RedisProvider) ScheduleMultiple

func (rp *RedisProvider) ScheduleMultiple(ctx context.Context, tasks []*types.Task) ([]*types.TaskResult, error)

ScheduleMultiple schedules multiple tasks

func (*RedisProvider) ScheduleTask

func (rp *RedisProvider) ScheduleTask(ctx context.Context, task *types.Task) (*types.TaskResult, error)

ScheduleTask schedules a task

func (*RedisProvider) UpdateTask

func (rp *RedisProvider) UpdateTask(ctx context.Context, task *types.Task) error

UpdateTask updates an existing task

Jump to

Keyboard shortcuts

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