func PutResourceBatch(key string, value []Resource) error {
	err := db.Update(func(tx *bolt.Tx) error {
		_, err := tx.CreateBucketIfNotExists([]byte("search"))
		if err != nil {
			return fmt.Errorf("create bucket: %s", err)
		}
		return nil
	})
	if err != nil {
		return err
	}

	return db.Batch(func(tx *bolt.Tx) error {
		b := tx.Bucket([]byte("search"))
		bytes, err := json.Marshal(value)
		if err != nil {
			return err
		}
		err = b.Put([]byte(key), bytes)
		if err != nil {
			return err
		}
		return nil
	})
}
// PutResourceBatch puts a batch of resources into the boltdb
PutResourceBatch puts a batch of resources into the boltdb
// PutResourceBatch puts a batch of resources into the boltdb
func PutResourceBatch(key string, value []Resource) error {
	err := db.Update(func(tx *bolt.Tx) error {
		_, err := tx.CreateBucketIfNotExists([]byte("search"))
		if err != nil {
			return fmt.Errorf("create bucket: %s", err)
		}
		return nil
	})
	if err != nil {
		return err
	}
	return db.Batch(func(tx *bolt.Tx) error {
		b := tx.Bucket([]byte("search"))
		bytes, err := json.Marshal(value)
		if err != nil {
			return err
		}
		err = b.Put([]byte(key), bytes)
		if err != nil {
			return err
		}
		return nil
	})
}
func PutResourceBatch ( key string , value [ ] Resource ) error { err := db . Update ( func ( tx * bolt . Tx ) error { _ , err := tx . CreateBucketIfNotExists ( [ ] byte ( " " ) ) if err != nil { return fmt . Errorf ( " " , err ) } return nil } ) if err != nil { return err } return db . Batch ( func ( tx * bolt . Tx ) error { b := tx . Bucket ( [ ] byte ( " " ) ) bytes , err := json . Marshal ( value ) if err != nil { return err } err = b . Put ( [ ] byte ( key ) , bytes ) if err != nil { return err } return nil } ) }
PutResourceBatch puts a batch of resources into the boltdb
PutResourceBatch puts a batch of resources into the boltdb