func (ep *EnvProvider) Get(key types.Key) (*types.KeyValue, bool) {
	<-ep.ready
	if val, ok := ep.registry[key.String()]; ok {
		return &types.KeyValue{Key: key, Value: val}, ok
	}
	return nil, false
}
Get is the primary method to fetch values from the provider registry.
package cfg
import (
	"os"
	"strings"
	"github.com/awesome-flow/flow/pkg/types"
)
var envVars = func() []string {
	return os.Environ()
}
func canonise(key string) string {
	k := strings.Replace(key, "_", ".", -1)
	k = strings.Replace(k, "..", "_", -1)
	return strings.ToLower(k)
}
type EnvProvider struct {
	weight   int
	registry map[string]types.Value
	ready    chan struct{}
}
var _ Provider = (*EnvProvider)(nil)
func NewEnvProvider(repo *Repository, weight int) (*EnvProvider, error) {
	prov := &EnvProvider{
		weight: weight,
		ready:  make(chan struct{}),
	}
	repo.RegisterProvider(prov)
	return prov, nil
}
func (ep *EnvProvider) Name() string { return "env" }
func (ep *EnvProvider) Depends() []string { return []string{"default"} }
func (ep *EnvProvider) Weight() int { return ep.weight }
func (ep *EnvProvider) SetUp(repo *Repository) error {
	defer close(ep.ready)
	registry := make(map[string]types.Value)
	var k string
	var v interface{}
	for _, kv := range envVars() {
		if !strings.HasPrefix(kv, "FLOW_") {
			continue
		}
		kv = kv[5:]
		if ix := strings.Index(kv, "="); ix != -1 {
			k, v = kv[:ix], kv[ix+1:]
		} else {
			k, v = kv, true
		}
		k = canonise(k)
		registry[k] = v
		if repo != nil {
			if err := repo.RegisterKey(types.NewKey(k), ep); err != nil {
				return err
			}
		}
	}
	ep.registry = registry
	return nil
}
func (ep *EnvProvider) TearDown(_ *Repository) error { return nil }