Exemple #1
0
// PutOnboardedApp puts information of onboarded app.
func (m *DB) PutOnboardedApp(app common.OnboardedApp) error {
	v, err := json.Marshal(&app)
	if err != nil {
		return err
	}
	return m.db.Update(func(tx *bolt.Tx) (err error) {
		onboards := tx.Bucket([]byte(boltOnboardedAppBucket))
		err = onboards.Put([]byte(app.LocalID()), v)
		if err != nil {
			return err
		}
		return nil
	})
}
Exemple #2
0
// PutOnboardedApp puts information of onboarded app.
func (db *DB) PutOnboardedApp(app common.OnboardedApp) error {
	db.lock.Lock()
	defer db.lock.Unlock()
	db.onboardedApps[app.LocalID()] = app
	return nil
}