func main() { log.Println("dddd demo") mgoCtx := NewMgoCtx(&MgoCfg{}) di.Map(mgoCtx) user.Init() di.Invoke(run) log.Println("dddd demo end") }
func Reg(agg ddd.Agg, repo db.Repo) { di.Map(repo) store.RegRepo(agg, repo) cmdbus.SetAgg(agg) }
func Init() { up := NewUserRepo() di.Map(up).Apply(up.MgoRepo) dddd.Reg(&UserAgg{}, up) }