示例#1
0
文件: dcdr.go 项目: vsco/dcdr
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()
}
示例#2
0
文件: client.go 项目: vsco/dcdr
// NewDefault creates a new default Client
func NewDefault() (c *Client, err error) {
	c, err = New(config.LoadConfig())

	return
}