Skip to content

Commit a06f7d2

Browse files
committed
Merge branch 'v2-feature-main'
2 parents 715e587 + 81237de commit a06f7d2

80 files changed

Lines changed: 700 additions & 558 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cache/memcache/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module github.com/dobyte/due/cache/memcache/v2
22

3-
go 1.24.0
3+
go 1.25.0
44

55
require (
66
github.com/bradfitz/gomemcache v0.0.0-20250403215159-8d39553ac7cf
7-
github.com/dobyte/due/v2 v2.5.2
8-
golang.org/x/sync v0.19.0
7+
github.com/dobyte/due/v2 v2.5.3
8+
golang.org/x/sync v0.20.0
99
)
1010

1111
require (

cache/memcache/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS
3636
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
3737
golang.org/x/arch v0.11.0 h1:KXV8WWKCXm6tRpLirl2szsO5j/oOODwZf4hATmGVNs4=
3838
golang.org/x/arch v0.11.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
39-
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
40-
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
39+
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
40+
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
4141
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
4242
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
4343
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=

cache/redis/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module github.com/dobyte/due/cache/redis/v2
22

3-
go 1.24.0
3+
go 1.25.0
44

55
require (
6-
github.com/dobyte/due/v2 v2.5.2
6+
github.com/dobyte/due/v2 v2.5.3
77
github.com/redis/go-redis/v9 v9.17.2
8-
golang.org/x/sync v0.19.0
8+
golang.org/x/sync v0.20.0
99
)
1010

1111
require (

cache/redis/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS
4444
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
4545
golang.org/x/arch v0.11.0 h1:KXV8WWKCXm6tRpLirl2szsO5j/oOODwZf4hATmGVNs4=
4646
golang.org/x/arch v0.11.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
47-
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
48-
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
47+
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
48+
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
4949
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
5050
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
5151
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=

cluster/cluster.go

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -117,25 +117,28 @@ type Message struct {
117117
}
118118

119119
type PushArgs struct {
120-
GID string // 网关ID,会话类型为用户时可忽略此参数
121-
Kind session.Kind // 会话类型,session.Conn 或 session.User
122-
Target int64 // 会话目标,CID 或 UID
123-
Message *Message // 推送消息
124-
Ack bool // 是否需要响应推送结果
120+
GID string // 网关ID,会话类型为用户时可忽略此参数
121+
Kind session.Kind // 会话类型,session.Conn 或 session.User
122+
Target int64 // 会话目标,CID 或 UID
123+
Message *Message // 推送消息
124+
Disconnect bool // 是否在推送消息后优雅地断开连接
125+
Ack bool // 是否需要响应推送结果
125126
}
126127

127128
type MulticastArgs struct {
128-
GID string // 网关ID,会话类型为用户时可忽略此参数
129-
Kind session.Kind // 会话类型,session.Conn 或 session.User
130-
Targets []int64 // 会话目标,CID 或 UID
131-
Message *Message // 组播消息
132-
Ack bool // 是否需要响应推送结果
129+
GID string // 网关ID,会话类型为用户时可忽略此参数
130+
Kind session.Kind // 会话类型,session.Conn 或 session.User
131+
Targets []int64 // 会话目标,CID 或 UID
132+
Message *Message // 组播消息
133+
Disconnect bool // 是否在推送消息后优雅地断开连接
134+
Ack bool // 是否需要响应推送结果
133135
}
134136

135137
type BroadcastArgs struct {
136-
Kind session.Kind // 会话类型,session.Conn 或 session.User
137-
Message *Message // 消息
138-
Ack bool // 是否需要响应推送结果
138+
Kind session.Kind // 会话类型,session.Conn 或 session.User
139+
Message *Message // 消息
140+
Disconnect bool // 是否在推送消息后优雅地断开连接
141+
Ack bool // 是否需要响应推送结果
139142
}
140143

141144
type SubscribeArgs struct {
@@ -153,9 +156,10 @@ type UnsubscribeArgs struct {
153156
}
154157

155158
type PublishArgs struct {
156-
Channel string // 频道
157-
Message *Message // 消息
158-
Ack bool // 是否需要响应推送结果
159+
Channel string // 频道
160+
Message *Message // 消息
161+
Disconnect bool // 是否在推送消息后优雅地断开连接
162+
Ack bool // 是否需要响应推送结果
159163
}
160164

161165
type TriggerArgs struct {

cluster/gate/provider.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ func (p *provider) Disconnect(ctx context.Context, kind session.Kind, target int
6767
}
6868

6969
// Push 发送消息
70-
func (p *provider) Push(ctx context.Context, kind session.Kind, target int64, message []byte) error {
71-
err := p.gate.session.Push(kind, target, message)
70+
func (p *provider) Push(ctx context.Context, kind session.Kind, target int64, disconnect bool, message []byte) error {
71+
err := p.gate.session.Push(kind, target, disconnect, message)
7272

7373
if kind == session.User && errors.Is(err, errors.ErrNotFoundSession) {
7474
xcall.Go(func() {
@@ -82,18 +82,18 @@ func (p *provider) Push(ctx context.Context, kind session.Kind, target int64, me
8282
}
8383

8484
// Multicast 推送组播消息
85-
func (p *provider) Multicast(ctx context.Context, kind session.Kind, targets []int64, message []byte) (int64, error) {
86-
return p.gate.session.Multicast(kind, targets, message)
85+
func (p *provider) Multicast(ctx context.Context, kind session.Kind, targets []int64, disconnect bool, message []byte) (int64, error) {
86+
return p.gate.session.Multicast(kind, targets, disconnect, message)
8787
}
8888

8989
// Broadcast 推送广播消息
90-
func (p *provider) Broadcast(ctx context.Context, kind session.Kind, message []byte) (int64, error) {
91-
return p.gate.session.Broadcast(kind, message)
90+
func (p *provider) Broadcast(ctx context.Context, kind session.Kind, disconnect bool, message []byte) (int64, error) {
91+
return p.gate.session.Broadcast(kind, disconnect, message)
9292
}
9393

9494
// Publish 发布频道消息
95-
func (p *provider) Publish(ctx context.Context, channel string, message []byte) int64 {
96-
return p.gate.session.Publish(channel, message)
95+
func (p *provider) Publish(ctx context.Context, channel string, disconnect bool, message []byte) int64 {
96+
return p.gate.session.Publish(channel, disconnect, message)
9797
}
9898

9999
// Subscribe 订阅频道

component/http/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/dobyte/due/component/http/v2
33
go 1.25.0
44

55
require (
6-
github.com/dobyte/due/v2 v2.5.2
6+
github.com/dobyte/due/v2 v2.5.3
77
github.com/go-openapi/runtime v0.28.0
88
github.com/gofiber/fiber/v3 v3.0.0-rc.3
99
)
@@ -48,7 +48,7 @@ require (
4848
golang.org/x/arch v0.11.0 // indirect
4949
golang.org/x/crypto v0.44.0 // indirect
5050
golang.org/x/net v0.47.0 // indirect
51-
golang.org/x/sync v0.19.0 // indirect
51+
golang.org/x/sync v0.20.0 // indirect
5252
golang.org/x/sys v0.38.0 // indirect
5353
golang.org/x/text v0.31.0 // indirect
5454
gopkg.in/yaml.v3 v3.0.1 // indirect

component/http/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ golang.org/x/crypto v0.44.0 h1:A97SsFvM3AIwEEmTBiaxPPTYpDC47w720rdiiUvgoAU=
111111
golang.org/x/crypto v0.44.0/go.mod h1:013i+Nw79BMiQiMsOPcVCB5ZIJbYkerPrGnOa00tvmc=
112112
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
113113
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
114-
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
115-
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
114+
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
115+
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
116116
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
117117
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
118118
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=

config/consul/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module github.com/dobyte/due/config/consul/v2
22

3-
go 1.24.0
3+
go 1.25.0
44

55
require (
6-
github.com/dobyte/due/v2 v2.5.2
6+
github.com/dobyte/due/v2 v2.5.3
77
github.com/hashicorp/consul/api v1.32.0
88
)
99

@@ -34,7 +34,7 @@ require (
3434
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
3535
golang.org/x/arch v0.11.0 // indirect
3636
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 // indirect
37-
golang.org/x/sync v0.19.0 // indirect
37+
golang.org/x/sync v0.20.0 // indirect
3838
golang.org/x/sys v0.29.0 // indirect
3939
gopkg.in/yaml.v3 v3.0.1 // indirect
4040
)

config/consul/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ
211211
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
212212
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
213213
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
214-
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
215-
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
214+
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
215+
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
216216
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
217217
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
218218
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=

0 commit comments

Comments
 (0)