diff --git a/store/store.go b/store/store.go index 1a8a0686..6d30ee19 100644 --- a/store/store.go +++ b/store/store.go @@ -5,6 +5,8 @@ package store import ( "errors" "time" + + "encoding/json" ) var ( @@ -49,3 +51,11 @@ type Record struct { func NewStore(opts ...Option) Store { return NewMemoryStore(opts...) } + +func NewRecord(key string, val interface{}) *Record { + b, _ := json.Marshal(val) + return &Record{ + Key: key, + Value: b, + } +}