aboutsummaryrefslogtreecommitdiffstats
path: root/repository/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'repository/config.go')
-rw-r--r--repository/config.go23
1 files changed, 15 insertions, 8 deletions
diff --git a/repository/config.go b/repository/config.go
index 2133b169..70d51f11 100644
--- a/repository/config.go
+++ b/repository/config.go
@@ -13,15 +13,11 @@ var (
// Config represent the common function interacting with the repository config storage
type Config interface {
- // Store writes a single key/value pair in the config
- StoreString(key, value string) error
-
- // Store writes a key and timestamp value to the config
- StoreTimestamp(key string, value time.Time) error
-
- // Store writes a key and boolean value to the config
- StoreBool(key string, value bool) error
+ ConfigRead
+ ConfigWrite
+}
+type ConfigRead interface {
// ReadAll reads all key/value pair matching the key prefix
ReadAll(keyPrefix string) (map[string]string, error)
@@ -39,6 +35,17 @@ type Config interface {
// Return ErrNoConfigEntry or ErrMultipleConfigEntry if
// there is zero or more than one entry for this key
ReadTimestamp(key string) (time.Time, error)
+}
+
+type ConfigWrite interface {
+ // Store writes a single key/value pair in the config
+ StoreString(key, value string) error
+
+ // Store writes a key and timestamp value to the config
+ StoreTimestamp(key string, value time.Time) error
+
+ // Store writes a key and boolean value to the config
+ StoreBool(key string, value bool) error
// RemoveAll removes all key/value pair matching the key prefix
RemoveAll(keyPrefix string) error