Files
sablier/pkg/store/store.go
Alexis Couvreur f29b13a55a refactor(storage): add store.Store interface
There is a first implementation with ValKey that will allow to use redis APIs as a backend for Sablier with Hight Availability
2025-02-02 18:13:45 -05:00

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
}