From 484eb3d15e310a3bc38e36cb2a1e3a3219a1b3da Mon Sep 17 00:00:00 2001 From: asim Date: Sun, 4 May 2025 20:00:44 +0100 Subject: [PATCH] public functions for store --- store/store.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/store/store.go b/store/store.go index 6d30ee19..c16d18db 100644 --- a/store/store.go +++ b/store/store.go @@ -59,3 +59,24 @@ func NewRecord(key string, val interface{}) *Record { Value: b, } } + +// Read records +func Read(key string, opts ...ReadOption) ([]*Record, error) { + // execute the query + return DefaultStore.Read(key, opts...) +} + +// Write a record to the store +func Write(r *Record) error { + return DefaultStore.Write(r) +} + +// Delete removes the record with the corresponding key from the store. +func Delete(key string) error { + return DefaultStore.Delete(key) +} + +// List returns any keys that match, or an empty list with no error if none matched. +func List(opts ...ListOption) ([]string, error) { + return DefaultStore.List(opts...) +}