forked from gsn/predictor
feat: downloader
This commit is contained in:
parent
b9c1a98895
commit
42e7924be9
37 changed files with 2422 additions and 94 deletions
21
pkg/redis/interface.go
Normal file
21
pkg/redis/interface.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package redis
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Service defines the interface for Redis operations
|
||||
type Service interface {
|
||||
// Lock acquires a distributed lock
|
||||
Lock(ctx context.Context, key string, ttl time.Duration) (func(context.Context), error)
|
||||
|
||||
// Set sets a key with value and TTL
|
||||
Set(key string, value []byte, ttl time.Duration) error
|
||||
|
||||
// Get retrieves a value by key
|
||||
Get(key string) ([]byte, error)
|
||||
|
||||
// Close closes the Redis connection
|
||||
Close() error
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue