// GetSources iterates through db, populate and return Sources.
GetSources iterates through db, populate and return Sources.
// GetSources iterates through db populate and return Sources .
func GetSources() (Sources, error) {
	store := make(Sources)
	iter := Db.NewIterator(nil, nil)
	for iter.Next() {
		k := utils.ToStr(iter.Key())
		switch k {
		case "ROOT_TREE":
		default:
			s := &Source{}
			err := json.Unmarshal(iter.Value(), s)
			if err != nil {
				log.Warn(err)
				continue
			}
			store[k] = s
		}
	}
	iter.Release()
	if err := iter.Error(); err != nil {
		return Sources{}, err
	}
	return store, nil
}
func GetSources ( ) ( Sources , error ) { store := make ( Sources ) iter := Db . NewIterator ( nil , nil ) for iter . Next ( ) { k := utils . ToStr ( iter . Key ( ) ) switch k { case " " : default : s := & Source { } err := json . Unmarshal ( iter . Value ( ) , s ) if err != nil { log . Warn ( err ) continue } store [ k ] = s } } iter . Release ( ) if err := iter . Error ( ) ; err != nil { return Sources { } , err } return store , nil }
GetSources iterates through db, populate and return Sources.
GetSources iterates through db populate and return Sources .