Example #1
0
// Open bolt data store.
func Open(path string, dropDatabase bool) (data.Store, error) {
	if dropDatabase {
		if _, err := os.Stat(path); err == nil {
			os.Remove(path)
		}
	}
	db, err := bolt.Open(path, 0600, &bolt.Options{Timeout: 1 * time.Second})
	if err != nil {
		return nil, err
	}
	// TODO init app buckets ()
	return kv.New(&store{db}), nil
}
Example #2
0
// New redis-like store.
func New(backend Store) data.Store {
	return kv.New(&store{backend})
}