production !
Can it be used in production?
Hello: We have four server used esim framework in production. I suggest you should know DDD and COLA before you use it.
狂旋
------------------ 原始邮件 ------------------ 发件人: "0x457"<[email protected]>; 发送时间: 2020年5月18日(星期一) 下午2:41 收件人: "jukylin/esim"<[email protected]>; 抄送: "Subscribed"<[email protected]>; 主题: [jukylin/esim] production ! (#1)
Can it be used in production?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
CREATE TABLE IF NOT EXISTS test(
id int not NULL auto_increment,
title VARCHAR(10) not NULL DEFAULT '',
PRIMARY KEY (`id`)
)engine=innodb;
run : esim db2entity -d saep-min -t test
panic: {"level":"panic","ts":"2020-05-19 16:26:11","msg":"err 97:3: expected statement, found '.' : package dao\n\nimport (\n\n "context"\n "github.com/jinzhu/gorm"\n "errors"\n "github.com/jukylin/esim/mysql"\n "saep.cn/wstest/"\n)\n\ntype TestDao struct{\n\tmysql *mysql.Client\n}\n\nfunc NewTestDao() *TestDao {\n\tdao := &TestDao{\n\t\tmysql : mysql.NewClient(),\n\t}\n\n\treturn dao\n}\n\n\n//主库\nfunc (td *TestDao) GetDb(ctx context.Context) *gorm.DB {\n\treturn td.mysql.GetCtxDb(ctx, "saep-mini").Table("test")\n}\n\n//从库\nfunc (td *TestDao) GetSlaveDb(ctx context.Context) *gorm.{\n\treturn td.mysql.GetCtxDb(ctx, "saep-mini_slave").Table("test")\n}\n\n\n//返回 自增id,错误\nfunc (td *TestDao)
esim db2entity -d saep-mini -t test
{"level":"error","ts":"2020-05-19 18:08:12","msg":"A panic occurred : runtime error: invalid memory address or nil pointer dereference","caller":"db2entity/db2entity.go:155","stacktrace":"github.com/jukylin/esim/log.(*logger).Errorf\n\t/Users/bruce/go/pkg/mod/github.com/jukylin/[email protected]/log/logger.go:98\ngithub.com/jukylin/esim/tool/db2entity.(*Db2Entity).Run.func1\n\t/Users/bruce/go/pkg/mod/github.com/jukylin/[email protected]/tool/db2entity/db2entity.go:155\nruntime.gopanic\n\t/usr/local/go/src/runtime/panic.go:969\nruntime.panicmem\n\t/usr/local/go/src/runtime/panic.go:212\nruntime.sigpanic\n\t/usr/local/go/src/runtime/signal_unix.go:695\ngithub.com/jukylin/esim/tool/db2entity.(*Db2Entity).Run\n\t/Users/bruce/go/pkg/mod/github.com/jukylin/[email protected]/tool/db2entity/db2entity.go:171\ngithub.com/jukylin/esim/tool/cmd.glob..func1\n\t/Users/bruce/go/pkg/mod/github.com/jukylin/[email protected]/tool/cmd/db2entity.go:66\ngithub.com/spf13/cobra.(*Command).execute\n\t/Users/bruce/go/pkg/mod/github.com/spf13/[email protected]/command.go:846\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/Users/bruce/go/pkg/mod/github.com/spf13/[email protected]/command.go:950\ngithub.com/spf13/cobra.(*Command).Execute\n\t/Users/bruce/go/pkg/mod/github.com/spf13/[email protected]/command.go:887\ngithub.com/jukylin/esim/tool/cmd.Execute\n\t/Users/bruce/go/pkg/mod/github.com/jukylin/[email protected]/tool/cmd/root.go:34\nmain.main\n\t/Users/bruce/go/pkg/mod/github.com/jukylin/[email protected]/tool/main.go:21\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:203"}
up to v0.0.9
狂旋
------------------ 原始邮件 ------------------ 发件人: "0x457"<[email protected]>; 发送时间: 2020年5月19日(星期二) 晚上6:10 收件人: "jukylin/esim"<[email protected]>; 抄送: "§的§"<[email protected]>;"Comment"<[email protected]>; 主题: Re: [jukylin/esim] production ! (#1)
esim db2entity -d saep-mini -t test
{"level":"error","ts":"2020-05-19 18:08:12","msg":"A panic occurred : runtime error: invalid memory address or nil pointer dereference","caller":"db2entity/db2entity.go:155","stacktrace":"github.com/jukylin/esim/log.(*logger).Errorf\n\t/Users/bruce/go/pkg/mod/github.com/jukylin/[email protected]/log/logger.go:98\ngithub.com/jukylin/esim/tool/db2entity.(*Db2Entity).Run.func1\n\t/Users/bruce/go/pkg/mod/github.com/jukylin/[email protected]/tool/db2entity/db2entity.go:155\nruntime.gopanic\n\t/usr/local/go/src/runtime/panic.go:969\nruntime.panicmem\n\t/usr/local/go/src/runtime/panic.go:212\nruntime.sigpanic\n\t/usr/local/go/src/runtime/signal_unix.go:695\ngithub.com/jukylin/esim/tool/db2entity.(*Db2Entity).Run\n\t/Users/bruce/go/pkg/mod/github.com/jukylin/[email protected]/tool/db2entity/db2entity.go:171\ngithub.com/jukylin/esim/tool/cmd.glob..func1\n\t/Users/bruce/go/pkg/mod/github.com/jukylin/[email protected]/tool/cmd/db2entity.go:66\ngithub.com/spf13/cobra.(*Command).execute\n\t/Users/bruce/go/pkg/mod/github.com/spf13/[email protected]/command.go:846\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/Users/bruce/go/pkg/mod/github.com/spf13/[email protected]/command.go:950\ngithub.com/spf13/cobra.(*Command).Execute\n\t/Users/bruce/go/pkg/mod/github.com/spf13/[email protected]/command.go:887\ngithub.com/jukylin/esim/tool/cmd.Execute\n\t/Users/bruce/go/pkg/mod/github.com/jukylin/[email protected]/tool/cmd/root.go:34\nmain.main\n\t/Users/bruce/go/pkg/mod/github.com/jukylin/[email protected]/tool/main.go:21\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:203"}
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
哥们,你是中国人吧!!!
狂旋
------------------ 原始邮件 ------------------ 发件人: "0x457"<[email protected]>; 发送时间: 2020年5月19日(星期二) 晚上6:00 收件人: "jukylin/esim"<[email protected]>; 抄送: "§的§"<[email protected]>;"Comment"<[email protected]>; 主题: Re: [jukylin/esim] production ! (#1)
fix
nothing! dont work! the same error!
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
哥们,你是中国人吧!!!
我是炎黄子孙。 :)
用esim db2entity -d saep-mini -t test生成的与原始new命令生成的不一样:结构/文件名==,另外还 有一些错误,给出了部分:
/usr/local/go/src/path/filepath/match.go:13:2: could not import unicode/utf8 (invalid package name: "") /usr/local/go/src/go/token/token.go:13:2: could not import unicode/utf8 (invalid package name: "") /usr/local/go/src/encoding/json/decode.go:19:2: could not import unicode/utf8 (invalid package name: "") /usr/local/go/src/database/sql/convert.go:17:2: could not import unicode/utf8 (invalid package name: "") /usr/local/go/src/go/scanner/scanner.go:18:2: could not import unicode/utf8 (invalid package name: "") /Users/bruce/go/src/github.com/jinzhu/gorm/dialect_mysql.go:11:2: could not import unicode/utf8 (invalid package name: "") /Users/bruce/go/src/saep.cn/wstest/internal/infra/dao/test.go:8:2: could not import github.com/jukylin/esim/mysql (cannot find package "github.com/jukylin/esim/mysql" in any of: /usr/local/go/src/github.com/jukylin/esim/mysql (from $GOROOT) /Users/bruce/go/src/github.com/jukylin/esim/mysql (from $GOPATH)) /Users/bruce/go/src/saep.cn/wstest/internal/infra/dao/test.go:35:8: undeclared name: entity /Users/bruce/go/src/saep.cn/wstest/internal/infra/dao/test.go:58:44: undeclared name: entity /Users/bruce/go/src/saep.cn/wstest/internal/infra/dao/test.go:72:46: undeclared name: entity /Users/bruce/go/src/saep.cn/wstest/internal/infra/repo/test.go:6:2: could not import github.com/jukylin/esim/log (cannot find package "github.com/jukylin/esim/log" in any of: /usr/local/go/src/github.com/jukylin/esim/log (from $GOROOT) /Users/bruce/go/src/github.com/jukylin/esim/log (from $GOPATH)) /Users/bruce/go/src/saep.cn/wstest/internal/infra/infra.go:6:2: could not import github.com/google/wire (cannot find package "github.com/google/wire" in any of:
你有很多依赖没有安装,esim项目你放在了GOPATH里面了?
肯定的