lot of new functionalities
This commit is contained in:
20
core/utils/storage/kv.go
Executable file
20
core/utils/storage/kv.go
Executable file
@@ -0,0 +1,20 @@
|
||||
package storage
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
type KVHandler interface {
|
||||
Put(k string, v any) error
|
||||
PutWithTTL(k string, v any, duration time.Duration) error
|
||||
Get(k string) (any, error)
|
||||
Delete(k string) error
|
||||
}
|
||||
|
||||
func NewKVHandler(cfg *viper.Viper) (KVHandler, error) {
|
||||
return NewEtcdHandler(cfg)
|
||||
return nil, nil
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user