func main() { cfg := config.LoadConfig() store := resolver.LoadStore(cfg) rp := repo.New(cfg) var gs *godspeed.Godspeed var err error if cfg.StatsEnabled() { gs, err = godspeed.New(cfg.Stats.Host, cfg.Stats.Port, false) if err != nil { printer.SayErr("%v", err) os.Exit(1) } } kv := api.New(store, rp, cfg, gs) ctrl := controller.New(cfg, kv) dcdr := cli.New(ctrl) dcdr.Run() }
// NewDefault creates a new default Client func NewDefault() (c *Client, err error) { c, err = New(config.LoadConfig()) return }