// Save modifies a single record.
17812
func (m *GormIdentityRepository) Save(ctx context.Context, model *Identity) error {
	defer goa.MeasureSince([]string{"goa", "db", "identity", "save"}, time.Now())

	err := m.db.Save(model).Error

	log.Debug(ctx, map[string]interface{}{
		"identity_id": model.ID,
	}, "Identity saved!")

	return errs.WithStack(err)
}
710727
func (bsj BlockStoreStateJSON) Save(db dbm.DB) {
	bytes, err := cdc.MarshalJSON(bsj)
	if err != nil {
		cmn.PanicSanity(fmt.Sprintf("Could not marshal state bytes: %v", err))
	}
	db.SetSync(blockStoreKey, bytes)
}
1315557
func (client *Client) Save() error {
    _, err := client.sendCommand("SAVE")
    if err != nil {
        return err
    }
    return nil
}
263595
func (target *PostgreSQLTarget) Save(eventData event.Event) error {
	return target.send(eventData)
}
1233891
func (c Client) Save() error {
	settings := settingsFile{Username: c.Username, SslVerify: c.SSLVerify,
		Controller: c.ControllerURL.String(), Token: c.Token, Limit: c.ResponseLimit}

	if settings.Limit <= 0 {
		settings.Limit = DefaultResponseLimit
	}

	settingsContents, err := json.Marshal(settings)

	if err != nil {
		return err
	}

	if err = os.MkdirAll(path.Join(FindHome(), "/.deis/"), 0700); err != nil {
		return err
	}

	return ioutil.WriteFile(locateSettingsFile(), settingsContents, 0600)
}
1076271
func (s *CookieStore) Save(w http.ResponseWriter, session *Session) error {
	cookieValue, err := securecookie.EncodeMulti(session.Name(), &session.Values, s.Codecs...)
	if err != nil {
		return err
	}
	http.SetCookie(w, newCookie(session.Name(), cookieValue, session.Config))
	return nil
}
1312776
func (cfg *Config) save(storage util.Storage) {
	storage.Set("uuid", []byte(cfg.id))
	storage.Set("version", []byte(fmt.Sprintf("%d", cfg.version)))
	storage.Set("configHash", []byte(cfg.configHash))
}
1230942
func (s *DB) Save(value interface{}) *DB {
	scope := s.NewScope(value)
	if !scope.PrimaryKeyZero() {
		newDB := scope.callCallbacks(s.parent.callbacks.updates).db
		if newDB.Error == nil && newDB.RowsAffected == 0 {
			return s.New().FirstOrCreate(value)
		}
		return newDB
	}
	return scope.callCallbacks(s.parent.callbacks.creates).db
}
45027
func (w *wrapper) Save() error {
	w.mut.Lock()
	defer w.mut.Unlock()

	fd, err := osutil.CreateAtomic(w.path)
	if err != nil {
		l.Debugln("CreateAtomic:", err)
		return err
	}

	if err := w.cfg.WriteXML(fd); err != nil {
		l.Debugln("WriteXML:", err)
		fd.Close()
		return err
	}

	if err := fd.Close(); err != nil {
		l.Debugln("Close:", err)
		return err
	}

	events.Default.Log(events.ConfigSaved, w.cfg)
	return nil
}
587576
func (db *memDB) Save(c *Container) error {
	return db.withTxn(func(txn *memdb.Txn) error {
		return txn.Insert(memdbContainersTable, c)
	})
}
1293032
func (c *Conf) Save(src interface{}) (err error) {
	nb, err := json.Marshal(src)
	if err != nil {
		return
	}

	err = ioutil.WriteFile(c.Path(), nb, 0666)
	if err != nil {
		return
	}

	return
}
936149
func (s *DbSession) Save(document Document) error {
	coll := s.collection(document.CollectionName())
	err := coll.Insert(document)
	if err != nil {
		return err
	}
	return nil
}
127564
func (c *ConfigFile) Save() error {
	rw, err := NewConfigReadWriter(c.version)
	if err != nil {
		return err
	}
	filename := rw.Filename(c)
	if filename == "" {
		return fmt.Errorf("Can't save config with empty filename")
	}
	if err := os.MkdirAll(filepath.Dir(filename), 0700); err != nil {
		return err
	}
	file, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
	if err != nil {
		return err
	}
	defer file.Close()
	return rw.SaveToWriter(file, c)
}
76264
func (n *node) Save(data interface{}) error {
	ref := reflect.ValueOf(data)

	if !ref.IsValid() || ref.Kind() != reflect.Ptr || ref.Elem().Kind() != reflect.Struct {
		return ErrStructPtrNeeded
	}

	cfg, err := extract(&ref)
	if err != nil {
		return err
	}

	if cfg.ID.IsZero {
		if !cfg.ID.IsInteger || !cfg.ID.Increment {
			return ErrZeroID
		}
	}

	return n.readWriteTx(func(tx *bolt.Tx) error {
		return n.save(tx, cfg, data, false)
	})
}
452182
func (f *File) Save() error {
	if f.Filename == "" {
		return ErrNoFilenameSupplied
	}
	return f.Write(f.Filename)
}
63948
func (r *Repo) Save(ctx context.Context, entity eh.Entity) error {
	sess := r.session.Copy()
	defer sess.Close()

	if entity.EntityID() == uuid.Nil {
		return eh.RepoError{
			Err:       eh.ErrCouldNotSaveEntity,
			BaseErr:   eh.ErrMissingEntityID,
			Namespace: eh.NamespaceFromContext(ctx),
		}
	}

	if _, err := sess.DB(r.dbName(ctx)).C(r.collection).UpsertId(
		entity.EntityID(), entity); err != nil {
		return eh.RepoError{
			Err:       eh.ErrCouldNotSaveEntity,
			BaseErr:   err,
			Namespace: eh.NamespaceFromContext(ctx),
		}
	}
	return nil
}
106521
func (runner *runner) Save(table Table) ([]byte, error) {
	runner.mu.Lock()
	defer runner.mu.Unlock()

	// run and return
	args := []string{"-t", string(table)}
	return runner.exec.Command(cmdIptablesSave, args...).CombinedOutput()
}