Add Str convenience method for KV items
This commit is contained in:
parent
3c8b68b503
commit
fd09bebedc
4 changed files with 16 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -19,4 +19,5 @@ type KV interface {
|
|||
Exists() bool
|
||||
Key() []byte
|
||||
Val() []byte
|
||||
Str() string
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue