22 lines
382 B
Go
22 lines
382 B
Go
// Copyright (C) 2018 Marius Schellenberger
|
|
|
|
package store
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
func storeErr(i interface{}) error {
|
|
return fmt.Errorf("store: %s", i)
|
|
}
|
|
|
|
var ErrKeyNotFound = storeErr("key not found")
|
|
|
|
type Store interface {
|
|
Marshaler
|
|
Get(string, interface{}) error
|
|
Set(string, interface{}) error
|
|
ForEach(func(string, []byte) error) error
|
|
Delete(string) error
|
|
Close() error
|
|
}
|