UpdateObject updates an object
(object *APIObject)
| 223 | |
| 224 | // UpdateObject updates an object |
| 225 | func (c *Cache) UpdateObject(object *APIObject) error { |
| 226 | err := c.db.Update(func(tx *bolt.Tx) error { |
| 227 | return boltUpdateObject(tx, object) |
| 228 | }) |
| 229 | |
| 230 | if nil != err { |
| 231 | Log.Debugf("%v", err) |
| 232 | return fmt.Errorf("Could not update/save object %v (%v)", object.ObjectID, object.Name) |
| 233 | } |
| 234 | |
| 235 | return nil |
| 236 | } |
| 237 | |
| 238 | func boltStoreObject(tx *bolt.Tx, object *APIObject) error { |
| 239 | b := tx.Bucket(bObjects) |
no test coverage detected