func Execute() {
	RootCmd.AddCommand(cobracmds.VersionCmd)
	if err := RootCmd.Execute(); err != nil {
		fmt.Println(err)
		os.Exit(1)
	}
}
Execute will start kache
package kache
import (
	"fmt"
	"os"
	"time"
	"github.com/spf13/cobra"
	"github.com/spf13/viper"
	cobracmds "github.com/kasvith/kache/internal/cobra-cmds"
	"github.com/kasvith/kache/internal/config"
	"github.com/kasvith/kache/internal/klogs"
	"github.com/kasvith/kache/internal/srv"
)
var verbose bool
var cfgFile string
var RootCmd = &cobra.Command{
	Use:   "kache",
	Short: "kache is a simple distributed in memory database",
	Long:  `A fast and a flexible in memory redis-compatible database`,
	Run:   runApp,
}
func init() {
	cobra.OnInitialize(initConfig)
	RootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "verbose output")
	RootCmd.PersistentFlags().BoolP("debug", "d", false, "output debug information")
	RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "configuration file")
	RootCmd.PersistentFlags().Bool("logging", true, "set application logs")
	RootCmd.PersistentFlags().String("logfile", "", "application log file")
	RootCmd.PersistentFlags().String("logtype", "default",
		`kache can output logs in different formats like json or logfmt. The default one is custom to kache.`)
	RootCmd.Flags().StringP("host", "", "127.0.0.1", "host for running application")
	RootCmd.Flags().IntP("port", "p", 7088, "port for running application")
	RootCmd.Flags().IntP("maxClients", "", 10000, "max connections can be handled")
	RootCmd.Flags().IntP("maxTimeout", "", 120, "max timeout for clients(in seconds)")
	viper.BindPFlag("port", RootCmd.Flags().Lookup("port"))
	viper.BindPFlag("host", RootCmd.Flags().Lookup("host"))
	viper.BindPFlag("maxClients", RootCmd.Flags().Lookup("maxClients"))
	viper.BindPFlag("maxTimeout", RootCmd.Flags().Lookup("maxTimeout"))
	viper.BindPFlag("verbose", RootCmd.PersistentFlags().Lookup("verbose"))
	viper.BindPFlag("logging", RootCmd.PersistentFlags().Lookup("logging"))
	viper.BindPFlag("logfile", RootCmd.PersistentFlags().Lookup("logfile"))
	viper.BindPFlag("logtype", RootCmd.PersistentFlags().Lookup("logtype"))
	viper.BindPFlag("debug", RootCmd.PersistentFlags().Lookup("debug"))
}
func initConfig() {
	loadingDefault := false
	viper.SetConfigType("toml")
	if cfgFile != "" {
		viper.SetConfigFile(cfgFile)
	} else {
		loadingDefault = true
		viper.SetConfigName("kache.default")
		viper.AddConfigPath("../config")
	}
	if err := viper.ReadInConfig(); err != nil {
		if !loadingDefault {
			fmt.Fprintf(os.Stderr, "Error reading config from %s : %s\n", viper.ConfigFileUsed(), err)
			os.Exit(1)
		}
		switch err.(type) {
		case viper.ConfigFileNotFoundError:
			fmt.Fprintf(os.Stderr, "Error reading config file from config directory\nLoading with application defaults...\n")
			break
		default:
			fmt.Fprintf(os.Stderr, "Error reading config in %s : %s\n", viper.ConfigFileUsed(), err)
			os.Exit(1)
		}
	}
}