mirror of
https://github.com/sablierapp/sablier.git
synced 2025-12-21 13:23:03 +01:00
There is a first implementation with ValKey that will allow to use redis APIs as a backend for Sablier with Hight Availability
20 lines
475 B
Go
20 lines
475 B
Go
package store
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"github.com/sablierapp/sablier/app/instance"
|
|
"time"
|
|
)
|
|
|
|
var ErrKeyNotFound = errors.New("key not found")
|
|
|
|
//go:generate mockgen -package storetest -source=store.go -destination=storetest/mocks_store.go *
|
|
|
|
type Store interface {
|
|
Get(context.Context, string) (instance.State, error)
|
|
Put(context.Context, instance.State, time.Duration) error
|
|
Delete(context.Context, string) error
|
|
OnExpire(context.Context, func(string)) error
|
|
}
|