func (db *Bolt) GetAllLinks() (map[string]models.Link, error) {

	results := map[string]models.Link{}

	err := db.store.View(func(tx *bolt.Tx) error {
		bucket := tx.Bucket([]byte(storage.LinksBucket))

		err := bucket.ForEach(func(key, value []byte) error {
			var link models.Link

			err := json.Unmarshal(value, &link)
			if err != nil {
				return err
			}

			results[string(key)] = link
			return nil
		})
		return err
	})
	if err != nil {
		return nil, err
	}

	return results, nil
}
// GetAllLinks returns an unpaginated list of current links
GetAllLinks returns an unpaginated list of current links
// GetAllLinks returns an unpaginated list of current links
func (db *Bolt) GetAllLinks() (map[string]models.Link, error) {
	results := map[string]models.Link{}
	err := db.store.View(func(tx *bolt.Tx) error {
		bucket := tx.Bucket([]byte(storage.LinksBucket))
		err := bucket.ForEach(func(key, value []byte) error {
			var link models.Link
			err := json.Unmarshal(value, &link)
			if err != nil {
				return err
			}
			results[string(key)] = link
			return nil
		})
		return err
	})
	if err != nil {
		return nil, err
	}
	return results, nil
}
func ( db * Bolt ) GetAllLinks ( ) ( map [ string ] models . Link , error ) { results := map [ string ] models . Link { } err := db . store . View ( func ( tx * bolt . Tx ) error { bucket := tx . Bucket ( [ ] byte ( storage . LinksBucket ) ) err := bucket . ForEach ( func ( key , value [ ] byte ) error { var link models . Link err := json . Unmarshal ( value , & link ) if err != nil { return err } results [ string ( key ) ] = link return nil } ) return err } ) if err != nil { return nil , err } return results , nil }
GetAllLinks returns an unpaginated list of current links
GetAllLinks returns an unpaginated list of current links