Skip to content

Commit cb04fd2

Browse files
committed
modify engine type and readme md
1 parent 4a2665d commit cb04fd2

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# outbox(实验性支持)
2-
发件箱模式
1+
# outbox 发件箱模式(实验性支持)
2+
3+
基于[EventBus](https://github.com/nilorg/eventbus),使用Go语言实现最终一致性的微服务分布式事务解决方案

gorm.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ import (
1414
"gorm.io/gorm"
1515
)
1616

17+
// EngineType engine type
18+
type EngineType int
19+
1720
const (
18-
// EngineTypeGorm ...
19-
EngineTypeGorm = "gorm"
21+
// EngineTypeGorm engine type for gorm
22+
EngineTypeGorm EngineType = iota + 1
2023
)
2124

2225
// gormEngine ...

outbox.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ type EngineOptions struct {
9292
}
9393

9494
// New 创建
95-
func New(typ string, v interface{}, eventBus eventbus.EventBus, options ...*EngineOptions) (engine Engine, err error) {
95+
func New(typ EngineType, v interface{}, eventBus eventbus.EventBus, options ...*EngineOptions) (engine Engine, err error) {
9696
if typ == EngineTypeGorm {
9797
db := v.(*gorm.DB)
9898
db.AutoMigrate(

0 commit comments

Comments
 (0)