func (st *Store) Read(id string) store.ReadTxn {
	st.RLock()
	return &readTxn{st: st, id: id}
}
Read makes a read-lock for the resource that lasts until Close is called.
package mockstore
import (
	"errors"
	"sync"
	"github.com/jirenius/go-res/store"
)
type Store struct {
	OnChangeCallbacks []func(id string, before, after interface{})
	sync.RWMutex
	Resources map[string]interface{}
	NewID func() string
	OnExists func(st *Store, id string) bool
	OnValue func(st *Store, id string) (interface{}, error)
	OnCreate func(st *Store, id string, v interface{}) error
	OnUpdate func(st *Store, id string, v interface{}) (interface{}, error)
	OnDelete func(st *Store, id string) (interface{}, error)
}
var _ store.Store = &Store{}
var errMissingID = errors.New("missing ID")
type readTxn struct {
	st     *Store
	id     string
	closed bool
}
type writeTxn struct {
	readTxn
}
func NewStore() *Store {
	return &Store{}
}
func (st *Store) Add(id string, v interface{}) *Store {
	if st.Resources == nil {
		st.Resources = make(map[string]interface{}, 1)
	}
	st.Resources[id] = v
	return st
}