// NewStore constructs a Store object at filepath, given some options. func NewStore(filepath string) (*Store, error) { s := &Store{} s.setOpts() var err error s.db, err = rdb.OpenDb(s.opt, filepath) return s, x.Wrap(err) }
func NewSyncStore(filepath string) (*Store, error) { s := &Store{} s.setOpts() s.wopt.SetSync(true) // Do synchronous writes. var err error s.db, err = rdb.OpenDb(s.opt, filepath) return s, x.Wrap(err) }