gotomicro / ego-component Goto Github PK
View Code? Open in Web Editor NEWEgo 的客户端组件最佳实践
License: MIT License
Ego 的客户端组件最佳实践
License: MIT License
可否支持在一个消费者组(ekafka.ConsumerGroup
)中消费多个主题?
例如:
package ekafka
type ConsumerGroupOptions struct {
...
Topic string
Topics []string
}
Describe alternatives you've considered
临时切换到 github.com/Shopify/sarama
Additional context
gorm 默认有个自己的日志模块, 会给标准输出打印日志, 并且功能和 egorm 有些重合(慢日志, record not found 日志).
是否应当默认关闭 gorm 日志, 或者增加一个配置项?
https://github.com/go-gorm/gorm/blob/master/logger/logger.go#L74
https://gorm.io/docs/logger.html
建议把emqtt 的连接组件也支持起来
当前 ekafka 仅支持 consumer - Topic 一对一的对应,某些场景下需要一个 consumer 监听多个 Topic 的事件,通过配置来配比较繁琐,大部分配置是相同的。
我按照ego-component的go.mod去选择的driver,在使用时,方法不兼容。
# gorm.io/driver/mysql
..\..\pkg\mod\gorm.io\driver\mysql@v1.2.3\migrator.go:224:38: cannot use column (variable of type Column) as gorm.ColumnType value in argument to append: Column does not implement gorm.ColumnType (missing m
ethod AutoIncrement)
# gorm.io/driver/sqlserver
..\..\pkg\mod\gorm.io\driver\sqlserver@v1.2.1\create.go:55:34: not enough arguments in call to field.ValueOf
have (reflect.Value)
want (context.Context, reflect.Value)
..\..\pkg\mod\gorm.io\driver\sqlserver@v1.2.1\create.go:61:36: not enough arguments in call to field.ValueOf
want (context.Context, reflect.Value)
..\..\pkg\mod\gorm.io\driver\sqlserver@v1.2.1\sqlserver.go:90:22: invalid operation: limit.Limit > 0 (mismatched types *int and untyped int)
..\..\pkg\mod\gorm.io\driver\sqlserver@v1.2.1\sqlserver.go:95:39: cannot use limit.Limit (variable of type *int) as int value in argument to strconv.Itoa
# gorm.io/driver/postgres
..\..\pkg\mod\gorm.io\driver\postgres@v1.2.3\migrator.go:341:38: cannot use column (variable of type Column) as gorm.ColumnType value in argument to append: Column does not implement gorm.ColumnType (missin
g method AutoIncrement)
以上依赖问题,是由ego的相关包触发的,依据是
> go mod why gorm.io/driver/postgres
gorm.io/driver/postgres
xxxapisrv/utils/db
github.com/gotomicro/ego-component/egorm
github.com/gotomicro/ego-component/egorm/internal/dsn
gorm.io/driver/postgres
> go mod why gorm.io/driver/mysql
xxxapisrv/utils/db
github.com/gotomicro/ego-component/egorm
github.com/gotomicro/ego-component/egorm/internal/dsn
gorm.io/driver/mysql
> go mod why gorm.io/driver/sqlserver
github.com/gotomicro/ego-component/egorm
github.com/gotomicro/ego-component/egorm/internal/dsn
gorm.io/driver/sqlserver
其中, 版本的选择依据为最新版本组件的go.mod https://github.com/gotomicro/ego-component/blob/master/egorm/go.mod
gorm.io\driver\[email protected]
gorm.io\driver\[email protected]
gorm.io\driver\[email protected]
使用ekafka组件时发现一个小bug,不过不影响功能。producer使用writemessage时的日志输出为能打印出topic,起初我以为是我代码写错了,后来追到源码发现,如果发送消息时,不指定topic,默认使用config配置的topic,这时就无法输出topic。
interceptor_client.go 138行处。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.