func SetDefaults(dbPath string) {
	var defaults = map[string]interface{}{
		"clipboard.timeout": "0s",
		"database.path":     dbPath,
		"editor":            "vim",
		"keyfile.path":      "",
		"session.prefix":    "kure:~ $",
		"session.scripts":   map[string]string{},
		"session.timeout":   "0s",
	}
	for k, v := range defaults {
		Set(k, v)
	}
}
SetDefaults populates the config map with the default values.
package config
import (
	"os"
	"path/filepath"
	"time"
	"github.com/awnumar/memguard"
	"github.com/pkg/errors"
	"github.com/spf13/cast"
)
func Init() error {
	configPath := os.Getenv("KURE_CONFIG")
	switch {
	case configPath != "":
		ext := filepath.Ext(configPath)
		if ext == "" || ext == "." {
			return errors.New("\"KURE_CONFIG\" environment variable must have an extension")
		}
	default:
		home, err := os.UserHomeDir()
		if err != nil {
			return errors.Wrap(err, "finding home directory")
		}
		home = filepath.Join(home, ".kure")
		if err := os.MkdirAll(home, 0700); err != nil {
			return errors.Wrap(err, "creating the directory")
		}
		configPath = filepath.Join(home, "kure.yaml")
		if _, err := os.Stat(configPath); err != nil {
			if os.IsNotExist(err) {
				SetDefaults(filepath.Join(home, "kure.db"))
				if err := Write(configPath, true); err != nil {
					return err
				}
			} else {
				return err
			}
		}
	}
	if err := Load(configPath); err != nil {
		return err
	}
	if IsSet("auth") {
		return errors.New("found invalid key: \"auth\"")
	}
	return nil
}
func FileUsed() string {
	return config.filename
}
func Get(key string) interface{} {
	return config.Get(key)
}
func GetEnclave(key string) *memguard.Enclave {
	v := config.Get(key)
	if v == nil {
		return nil
	}
	return v.(*memguard.Enclave)
}
func GetDuration(key string) time.Duration {
	return cast.ToDuration(config.Get(key))
}
func GetString(key string) string {
	return cast.ToString(config.Get(key))
}
func GetStringMapString(key string) map[string]string {
	return cast.ToStringMapString(config.Get(key))
}
func GetUint32(key string) uint32 {
	return cast.ToUint32(config.Get(key))
}
func IsSet(key string) bool {
	return config.Get(key) != nil
}
func Load(configPath string) error {
	return config.Load(configPath)
}
func Reset() {
	config = New()
}
func Set(key string, value interface{}) {
	config.Set(key, value)
}