// Save batch put all the entries in the mapping.
Save batch put all the entries in the mapping.
// Save batch put all the entries in the mapping .
func (s Sources) Save() error {
	b := new(leveldb.Batch)
	for k, source := range s {
		data, err := json.Marshal(source)
		if err != nil {
			log.Warn(err)
			continue
		}
		b.Put(utils.ToByte(k), data)
	}
	return Db.Write(b, nil)
}
func ( s Sources ) Save ( ) error { b := new ( leveldb . Batch ) for k , source := range s { data , err := json . Marshal ( source ) if err != nil { log . Warn ( err ) continue } b . Put ( utils . ToByte ( k ) , data ) } return Db . Write ( b , nil ) }
Save batch put all the entries in the mapping.
Save batch put all the entries in the mapping .