diff --git a/kvs/boltdb/kv.go b/kvs/boltdb/kv.go index 000498fe..5700b097 100644 --- a/kvs/boltdb/kv.go +++ b/kvs/boltdb/kv.go @@ -35,3 +35,8 @@ func (kv *KV) Key() []byte { func (kv *KV) Val() []byte { return kv.val } + +// Str returns a string of the value +func (kv *KV) Str() string { + return string(kv.val) +} diff --git a/kvs/kv.go b/kvs/kv.go index 730d5b9e..07f35566 100644 --- a/kvs/kv.go +++ b/kvs/kv.go @@ -19,4 +19,5 @@ type KV interface { Exists() bool Key() []byte Val() []byte + Str() string } diff --git a/kvs/mysql/kv.go b/kvs/mysql/kv.go index fa2a3160..181dc8e4 100644 --- a/kvs/mysql/kv.go +++ b/kvs/mysql/kv.go @@ -35,3 +35,8 @@ func (kv *KV) Key() []byte { func (kv *KV) Val() []byte { return kv.val } + +// Str returns a string of the value +func (kv *KV) Str() string { + return string(kv.val) +} diff --git a/kvs/pgsql/kv.go b/kvs/pgsql/kv.go index 44f40269..e1193002 100644 --- a/kvs/pgsql/kv.go +++ b/kvs/pgsql/kv.go @@ -35,3 +35,8 @@ func (kv *KV) Key() []byte { func (kv *KV) Val() []byte { return kv.val } + +// Str returns a string of the value +func (kv *KV) Str() string { + return string(kv.val) +}