func (interactor *FeatureService) GetFeatures() (features m.FeatureFlags, err error) {
	_ = interactor.DB.View(func(tx *bolt.Tx) error {
		features, err = repos.GetFeatures(tx)
		return err
	})
	return
}
GetFeatures gets a list of feature flags
package services
import (
	"fmt"
	m "github.com/antoineaugusti/feature-flags/models"
	repos "github.com/antoineaugusti/feature-flags/repos"
	"github.com/boltdb/bolt"
)
type FeatureService struct {
	DB *bolt.DB
}
func (interactor *FeatureService) AddFeature(newFeature m.FeatureFlag) error {
	return interactor.DB.Update(func(tx *bolt.Tx) error {
		feature, err := repos.GetFeature(tx, newFeature.Key)
		if err != nil && err.Error() != "Unable to find feature" {
			return err
		}
		if len(feature.Key) > 0 {
			return fmt.Errorf("Feature already exists")
		}
		return repos.PutFeature(tx, newFeature)
	})
}