Skip to content
/ due Public

A lightweight distributed game server framework developed based on Go language.

License

Notifications You must be signed in to change notification settings

dobyte/due

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

due

Build Status goproxy Go Reference License: MIT Go Report Card Coverage Awesome Go

1.ไป‹็ป

dueๆ˜ฏไธ€ๆฌพๅŸบไบŽGo่ฏญ่จ€ๅผ€ๅ‘็š„่ฝป้‡็บงๅˆ†ๅธƒๅผๆธธๆˆๆœๅŠกๅ™จๆก†ๆžถใ€‚ ๅ…ถไธญ๏ผŒๆจกๅ—่ฎพ่ฎกๆ–น้ขๅ€Ÿ้‰ดไบ†kratos็š„ๆจกๅ—่ฎพ่ฎกๆ€่ทฏ๏ผŒไธบๅผ€ๅ‘่€…ๆไพ›ไบ†่พƒไธบ็ตๆดป็š„้›†็พคๆž„ๅปบๆ–นๆกˆใ€‚

ๆžถๆž„ๅ›พ

2.ไผ˜ๅŠฟ

  • ็ฎ€ๅ•ๆ€ง๏ผšๆžถๆž„็ฎ€ๅ•๏ผŒๆบ็ ็ฎ€ๆดๆ˜“็†่งฃใ€‚
  • ไพฟๆทๆ€ง๏ผšไป…ๆšด้œฒๅฟ…่ฆ็š„่ฐƒ็”จๆŽฅๅฃ๏ผŒๅ‡่ฝปๅผ€ๅ‘่€…็š„ๅฟƒๆ™บ่ดŸๆ‹…ใ€‚
  • ้ซ˜ๆ€ง่ƒฝ๏ผšๆก†ๆžถๅŽŸ็”Ÿๅฎž็Žฐ้›†็พค้€šไฟกๆ–นๆกˆ๏ผŒๆ™ฎ้€šๆœบๅ™จๅ•็บฟ็จ‹ไนŸ่ƒฝ่ฝปๆพๅฎž็Žฐ20W็š„TPSใ€‚
  • ้ซ˜ๆ•ˆๆ€ง๏ผšๆก†ๆžถๅŽŸ็”Ÿๆไพ›tcpใ€kcpใ€ws็ญ‰ๅ่ฎฎ็š„ๆœๅŠกๅ™จ๏ผŒๆ–นไพฟๅผ€ๅ‘่€…ๅฟซ้€Ÿๆž„ๅปบๅ„็ง็ฑปๅž‹็š„็ฝ‘ๅ…ณๆœๅŠกๅ™จใ€‚
  • ๆ‰ฉๅฑ•ๆ€ง๏ผš้‡‡็”จ่‰ฏๅฅฝ็š„ๆŽฅๅฃ่ฎพ่ฎก๏ผŒๆ–นไพฟๅผ€ๅ‘่€…่ฎพ่ฎกๅฎž็Žฐ่‡ชๆœ‰ๅŠŸ่ƒฝใ€‚
  • ๅนณๆป‘ๆ€ง๏ผšๅผ•ๅ…ฅไฟกๅท้‡๏ผŒ้€š่ฟ‡ๆŽงๅˆถๆœๅŠกๆณจๅ†Œไธญๅฟƒๆฅๅฎž็Žฐไผ˜้›…ๅœฐๆปšๅŠจๆ›ดๆ–ฐใ€‚
  • ๆ‰ฉๅฎนๆ€ง๏ผš้€š่ฟ‡ไผ˜้›…็š„่ทฏ็”ฑๅˆ†ๅ‘ๆœบๅˆถ๏ผŒ็†่ฎบไธŠๅฏๅฎž็Žฐๆ— ้™ๆ‰ฉๅฎนใ€‚
  • ๆ˜“่ฐƒ่ฏ•๏ผšๆก†ๆžถๅŽŸ็”Ÿๆไพ›ไบ†tcpใ€kcpใ€ws็ญ‰ๅ่ฎฎ็š„ๅฎขๆˆท็ซฏ๏ผŒๆ–นไพฟๅผ€ๅ‘่€…่ฟ›่กŒ็‹ฌ็ซ‹็š„่ฐƒ่ฏ•ๅ…จๆต็จ‹่ฐƒ่ฏ•ใ€‚
  • ๅฏ็ฎก็†๏ผšๆไพ›ๅฎŒๅ–„็š„ๅŽๅฐ็ฎก็†ๆŽฅๅฃ๏ผŒๆ–นไพฟๅผ€ๅ‘่€…ๅฟซ้€Ÿๅฎž็Žฐ่‡ชๅฎšไน‰็š„ๅŽๅฐ็ฎก็†ๅŠŸ่ƒฝใ€‚

3.ๅŠŸ่ƒฝ

  • ็ฝ‘ๅ…ณ๏ผšๆ”ฏๆŒtcpใ€kcpใ€ws็ญ‰ๅ่ฎฎ็š„็ฝ‘ๅ…ณๆœๅŠกๅ™จใ€‚
  • ๆ—ฅๅฟ—๏ผšๆ”ฏๆŒstdใ€zapใ€logrusใ€aliyunใ€tencent็ญ‰ๅคš็งๆ—ฅๅฟ—็ป„ไปถใ€‚
  • ๆณจๅ†Œ๏ผšๆ”ฏๆŒconsulใ€etcdใ€nacos็ญ‰ๅคš็งๆœๅŠกๆณจๅ†Œไธญๅฟƒใ€‚
  • ๅ่ฎฎ๏ผšๆ”ฏๆŒjsonใ€protobufใ€msgpack็ญ‰ๅคš็ง้€šไฟกๅ่ฎฎใ€‚
  • ้…็ฝฎ๏ผšๆ”ฏๆŒconsulใ€etcdใ€nacos็ญ‰ๅคš็ง้…็ฝฎไธญๅฟƒ๏ผ›ๅนถๆ”ฏๆŒjsonใ€yamlใ€tomlใ€xml็ญ‰ๅคš็งๆ–‡ไปถๆ ผๅผใ€‚
  • ้€šไฟก๏ผšๆ”ฏๆŒgrpcใ€rpcx็ญ‰ๅคš็ง้ซ˜ๆ€ง่ƒฝ้€šไฟกๆ–นๆกˆใ€‚
  • ้‡ๅฏ๏ผšๆ”ฏๆŒๆœๅŠกๅ™จ็š„ๅนณๆป‘้‡ๅฏใ€‚
  • ไบ‹ไปถ๏ผšๆ”ฏๆŒredisใ€natsใ€kafkaใ€rabbitMQ็ญ‰ไบ‹ไปถๆ€ป็บฟๅฎž็Žฐๆ–นๆกˆใ€‚
  • ๅŠ ๅฏ†๏ผšๆ”ฏๆŒrsaใ€ecc็ญ‰ๅคš็งๅŠ ๅฏ†ๆ–นๆกˆใ€‚
  • ๆœๅŠก๏ผšๆ”ฏๆŒgrpcใ€rpcx็ญ‰ๅคš็งๅพฎๆœๅŠก่งฃๅ†ณๆ–นๆกˆใ€‚
  • ็ตๆดป๏ผšๆ”ฏๆŒๅ•ไฝ“ใ€ๅˆ†ๅธƒๅผ็ญ‰ๅคš็งๆžถๆž„ๆ–นๆกˆใ€‚
  • ็ฎก็†๏ผšๆไพ›masterๅŽๅฐ็ฎก็†ๆœ็›ธๅ…ณๆŽฅๅฃๆ”ฏๆŒใ€‚
  • Web๏ผšๆไพ›httpๅ่ฎฎ็š„fiberๆœๅŠกๅ™จๅŠswaggerๆ–‡ๆกฃ่งฃๅ†ณๆ–นๆกˆใ€‚
  • ๅทฅๅ…ท๏ผšๆไพ›due-cli่„šๆ‰‹ๆžถๅทฅๅ…ท็ฎฑ๏ผŒๅฏๅฟซ้€Ÿๆž„ๅปบ้›†็พค้กน็›ฎใ€‚
  • Actor๏ผšๆไพ›ๅฎŒๅ–„actorๆจกๅž‹่งฃๅ†ณๆ–นๆกˆใ€‚

4.ไธ‹ไธ€ๆœŸๆ–ฐๅŠŸ่ƒฝ่ง„ๅˆ’

  • ๅฎž็Žฐๆก†ๆžถๅฑ‚็š„ๅˆ†ๅธƒๅผ้”

5.็‰นๆฎŠ่ฏดๆ˜Ž

ๅœจdueไบคๆต็พคไธญ็ปๅธธๆœ‰ๅฐไผ™ไผดๆๅŠๅˆฐGateใ€Nodeใ€Meshไน‹้—ดๅˆฐๅบ•ๆ˜ฏไธชไป€ไนˆๅ…ณ็ณป๏ผŒ่ฟ™้‡Œๅฐฑๅšไธ€ไธช็ปŸไธ€็š„่งฃ็ญ”

  • Gate๏ผš็ฝ‘ๅ…ณๆœ๏ผŒไธป่ฆ็”จไบŽ็ฎก็†ๅฎขๆˆท็ซฏ่ฟžๆŽฅ๏ผŒๆŽฅๆ”ถๅฎขๆˆท็ซฏ็š„่ทฏ็”ฑๆถˆๆฏ๏ผŒๅนถๅˆ†ๅ‘่ทฏ็”ฑๆถˆๆฏๅˆฐไธๅŒ็š„็š„Node่Š‚็‚นๆœใ€‚
  • Node: ่Š‚็‚นๆœ๏ผŒไฝœไธบๆ•ดไธช้›†็พค็ณป็ปŸ็š„ๆ ธๅฟƒ็ป„ไปถ๏ผŒไธป่ฆ็”จไบŽๆ ธๅฟƒ้€ป่พ‘ไธšๅŠก็š„็ผ–ๅ†™ใ€‚Node่Š‚็‚นๆœๅŠกๅฏไปฅๆ นๆฎไธšๅŠก้œ€่ฆๅšๆˆๆœ‰็Šถๆ€ๆˆ–ๆ— ็Šถๆ€็š„่Š‚็‚น๏ผŒๅฝ“ไฝœไธบๆ— ็Šถๆ€็š„่Š‚็‚นๆ—ถ๏ผŒNode่Š‚็‚นไธŽMeshๅพฎๆœๅŠกๅŸบๆœฌๆ— ๅผ‚๏ผ›ไฝ†ๅฝ“Node่Š‚็‚นไฝœไธบๆœ‰็Šถๆ€่Š‚็‚นๆ—ถ๏ผŒNode่Š‚็‚นไพฟไธ่ƒฝ้šๆ„ๆ›ดๆ–ฐ่ฟ›่กŒ้‡ๅฏๆ“ไฝœใ€‚ๆ•…่€ŒNodeไธŽMeshๅˆ†็ฆป็š„ไธšๅŠกๅœบๆ™ฏ็š„ไปทๅ€ผๅฐฑไฝ“็Žฐๅ‡บๆฅไบ†ใ€‚
  • Mesh๏ผšๅพฎๆœๅŠก๏ผŒไธป่ฆ็”จไบŽๆ— ็Šถๆ€็š„ไธšๅŠก้€ป่พ‘็ผ–ๅ†™ใ€‚Mesh่ƒฝๅš็š„ๅŠŸ่ƒฝNodeไธ€ๆ ทๅฏไปฅๅฎŒๆˆ๏ผŒๅฆ‚ไฝ•้€‰ๆ‹ฉๅฎŒๅ…จๅ–ๅ†ณไบŽ่‡ช่บซไธšๅŠกๅœบๆ™ฏ๏ผŒๅผ€ๅ‘่€…ๅฏไปฅๆ นๆฎ่‡ช่บซไธšๅŠกๅœบๆ™ฏ็ตๆดปๆญ้…ใ€‚
  • Master๏ผš็ฎก็†ๆœ๏ผŒไธป่ฆ็”จไบŽGMๅŽๅฐ็ฎก็†ๅŠŸ่ƒฝ็š„ๅผ€ๅ‘ใ€‚

6.้€šไฟกๅ่ฎฎ

ๅœจdueๆก†ๆžถไธญ๏ผŒ้€šไฟกๅ่ฎฎ็ปŸไธ€้‡‡็”จsize+header+route+seq+message็š„ๆ ผๅผ๏ผš

1.ๆ•ฐๆฎๅŒ…

 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+---------------------------------------------------------------+-+-------------+-------------------------------+-------------------------------+
|                              size                             |h|   extcode   |             route             |              seq              |
+---------------------------------------------------------------+-+-------------+-------------------------------+-------------------------------+
|                                                                message data ...                                                               |
+-----------------------------------------------------------------------------------------------------------------------------------------------+

2.ๅฟƒ่ทณๅŒ…

 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+---------------------------------------------------------------+-+-------------+---------------------------------------------------------------+
|                              size                             |h|   extcode   |                      heartbeat time (ns)                      |
+---------------------------------------------------------------+-+-------------+---------------------------------------------------------------+

size: 4 bytes

  • ๅŒ…้•ฟๅบฆไฝ
  • ๅ›บๅฎš้•ฟๅบฆไธบ4ๅญ—่Š‚๏ผŒไธ”ไธๅฏไฟฎๆ”น

header: 1 bytes

h: 1 bit

  • ๅฟƒ่ทณๆ ‡่ฏ†ไฝ
  • %x0 ่กจ็คบๆ•ฐๆฎๅŒ…
  • %x1 ่กจ็คบๅฟƒ่ทณๅŒ…

extcode: 7 bit

  • ๆ‰ฉๅฑ•ๆ“ไฝœ็ 
  • ๆš‚ๆœชๆ˜Ž็กฎๅฎšไน‰ๅ…ทไฝ“ๆ“ไฝœ็ 

route: 1 bytes | 2 bytes | 4 bytes

  • ๆถˆๆฏ่ทฏ็”ฑ
  • ้ป˜่ฎค้‡‡็”จ2ๅญ—่Š‚๏ผŒๅฏ้€š่ฟ‡ๆ‰“ๅŒ…ๅ™จ้…็ฝฎpacket.routeBytes่ฟ›่กŒไฟฎๆ”น
  • ไธๅŒ็š„่ทฏ็”ฑๅฏนๅบ”ไธๅŒ็š„ไธšๅŠกๅค„็†ๆต็จ‹
  • ๅฟƒ่ทณๅŒ…ๆ— ๆถˆๆฏ่ทฏ็”ฑไฝ
  • ๆญคๅ‚ๆ•ฐ็”ฑไธšๅŠกๆ‰“ๅŒ…ๅ™จๆ‰“ๅŒ…๏ผŒๆœๅŠกๅ™จๅผ€ๅ‘่€…ๅ’Œๅฎขๆˆท็ซฏๅผ€ๅ‘่€…ๅ‡่ฆๅ…ณๅฟƒๆญคๅ‚ๆ•ฐ

seq: 0 bytes | 1 bytes | 2 bytes | 4 bytes

  • ๆถˆๆฏๅบๅˆ—ๅท
  • ้ป˜่ฎค้‡‡็”จ2ๅญ—่Š‚๏ผŒๅฏ้€š่ฟ‡ๆ‰“ๅŒ…ๅ™จ้…็ฝฎpacket.seqBytes่ฟ›่กŒไฟฎๆ”น
  • ๅฏ้€š่ฟ‡ๅฐ†ๆ‰“ๅŒ…ๅ™จ้…็ฝฎpacket.seqBytes่ฎพ็ฝฎไธบ0ๆฅๅฑ่”ฝไฝฟ็”จๅบๅˆ—ๅท
  • ๆถˆๆฏๅบๅˆ—ๅทๅธธ็”จไบŽ่ฏทๆฑ‚/ๅ“ๅบ”ๆจกๅž‹็š„ๆถˆๆฏๅฏนๅ„ฟ็š„็กฎ่ฎค
  • ๅฟƒ่ทณๅŒ…ๆ— ๆถˆๆฏๅบๅˆ—ๅทไฝ
  • ๆญคๅ‚ๆ•ฐ็”ฑไธšๅŠกๆ‰“ๅŒ…ๅ™จpacket.Packerๆ‰“ๅŒ…๏ผŒๆœๅŠกๅ™จๅผ€ๅ‘่€…ๅ’Œๅฎขๆˆท็ซฏๅผ€ๅ‘่€…ๅ‡่ฆๅ…ณๅฟƒๆญคๅ‚ๆ•ฐ

message data: n bytes

  • ๆถˆๆฏๆ•ฐๆฎ
  • ๅฟƒ่ทณๅŒ…ๆ— ๆถˆๆฏๆ•ฐๆฎ
  • ๆญคๅ‚ๆ•ฐ็”ฑไธšๅŠกๆ‰“ๅŒ…ๅ™จpacket.Packerๆ‰“ๅŒ…๏ผŒๆœๅŠกๅ™จๅผ€ๅ‘่€…ๅ’Œๅฎขๆˆท็ซฏๅผ€ๅ‘่€…ๅ‡่ฆๅ…ณๅฟƒๆญคๅ‚ๆ•ฐ

heartbeat time: 8 bytes

  • ๅฟƒ่ทณๆ•ฐๆฎ
  • ๆ•ฐๆฎๅŒ…ๆ— ๅฟƒ่ทณๆ•ฐๆฎ
  • ไธŠ่กŒๅฟƒ่ทณๅŒ…ๆ— ้œ€ๆบๅธฆๅฟƒ่ทณๆ•ฐๆฎ๏ผŒไธ‹่กŒๅฟƒ่ทณๅŒ…้ป˜่ฎคๆบๅธฆ8 bytes็š„ๆœๅŠกๅ™จๆ—ถ้—ด๏ผˆns๏ผ‰๏ผŒๅฏ้€š่ฟ‡็ฝ‘็ปœๅบ“้…็ฝฎ่ฟ›่กŒ่ฎพ็ฝฎๆ˜ฏๅฆๆบๅธฆไธ‹่กŒๅŒ…ๆ—ถ้—ดไฟกๆฏ
  • ๆญคๅ‚ๆ•ฐ็”ฑ็ฝ‘็ปœๆก†ๆžถๅฑ‚่‡ชๅŠจๆ‰“ๅŒ…๏ผŒๆœๅŠก็ซฏๅผ€ๅ‘่€…ไธๅ…ณๆณจๆญคๅ‚ๆ•ฐ๏ผŒๅฎขๆˆท็ซฏๅผ€ๅ‘่€…้œ€ๅ…ณๆณจๆญคๅ‚ๆ•ฐ

7.็›ธๅ…ณๅทฅๅ…ท้“พ

1.ๅฎ‰่ฃ…protobuf็ผ–่ฏ‘ๅ™จ๏ผˆไฝฟ็”จๅœบๆ™ฏ๏ผšๅผ€ๅ‘meshๅพฎๆœๅŠก๏ผ‰

  • Linux, using apt or apt-get, for example:
$ apt install -y protobuf-compiler
$ protoc --version  # Ensure compiler version is 3+
  • MacOS, using Homebrew:
$ brew install protobuf
$ protoc --version  # Ensure compiler version is 3+
  • Windows, download from Github:

2.ๅฎ‰่ฃ…protobuf goไปฃ็ ็”Ÿๆˆๅทฅๅ…ท๏ผˆไฝฟ็”จๅœบๆ™ฏ๏ผšๅผ€ๅ‘meshๅพฎๆœๅŠก๏ผ‰

go install github.com/gogo/protobuf/protoc-gen-gofast@latest

3.ๅฎ‰่ฃ…grpcไปฃ็ ็”Ÿๆˆๅทฅๅ…ท๏ผˆไฝฟ็”จๅœบๆ™ฏ๏ผšไฝฟ็”จGRPC็ป„ไปถๅผ€ๅ‘meshๅพฎๆœๅŠก๏ผ‰

go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

4.ๅฎ‰่ฃ…rpcxไปฃ็ ็”Ÿๆˆๅทฅๅ…ท๏ผˆไฝฟ็”จๅœบๆ™ฏ๏ผšไฝฟ็”จRPCX็ป„ไปถๅผ€ๅ‘meshๅพฎๆœๅŠก๏ผ‰

go install github.com/rpcxio/protoc-gen-rpcx@latest

5.ๅฎ‰่ฃ…gorm daoไปฃ็ ็”Ÿๆˆๅทฅๅ…ท๏ผˆไฝฟ็”จๅœบๆ™ฏ๏ผšไฝฟ็”จGORMไฝœไธบๆ•ฐๆฎๅบ“orm๏ผ‰

go install github.com/dobyte/gorm-dao-generator@latest

6.ๅฎ‰่ฃ…mongo daoไปฃ็ ็”Ÿๆˆๅทฅๅ…ท๏ผˆไฝฟ็”จๅœบๆ™ฏ๏ผšไฝฟ็”จMongoDBไฝœไธบๆ•ฐๆฎๅบ“orm๏ผ‰

go install github.com/dobyte/mongo-dao-generator@latest

8.้…็ฝฎไธญๅฟƒ

1.ๅŠŸ่ƒฝไป‹็ป

้…็ฝฎไธญๅฟƒไธป่ฆๅฎšไฝไบŽไธšๅŠก็š„้…็ฝฎ็ฎก็†๏ผŒๆไพ›ๅฟซๆท็ตๆดป็š„้…็ฝฎๆ–นๆกˆใ€‚ๆ”ฏๆŒๅฎŒๅ–„็š„่ฏปๅ–ใ€ไฟฎๆ”นใ€ๅˆ ้™คใ€็ƒญๆ›ดๆ–ฐ็ญ‰ๅŠŸ่ƒฝใ€‚

2.ๆ”ฏๆŒ็ป„ไปถ

9.ๆณจๅ†Œไธญๅฟƒ

1.ๅŠŸ่ƒฝไป‹็ป

ๆณจๅ†Œไธญๅฟƒ็”จไบŽ้›†็พคๅฎžไพ‹็š„ๆœๅŠกๆณจๅ†Œๅ’Œๅ‘็Žฐใ€‚ๆ”ฏๆ’‘ๆ•ดไธช้›†็พค็š„ๆ— ๆ„Ÿ็Ÿฅๅœๆœใ€้‡ๅฏใ€ๅŠจๆ€ๆ‰ฉๅฎน็ญ‰ๅŠŸ่ƒฝใ€‚

2.ๆ”ฏๆŒ็ป„ไปถ

10.็ฝ‘็ปœๆจกๅ—

1.ๅŠŸ่ƒฝไป‹็ป

็ฝ‘็ปœๆจกๅ—ไธป่ฆไปฅ็ป„ไปถ็š„ๅฝขๅผ้›†ๆˆไบŽ็ฝ‘ๅ…ณๆจกๅ—๏ผŒไธบ็ฝ‘ๅ…ณๆไพ›็ตๆดป็š„็ฝ‘็ปœ้€šไฟกๆ”ฏๆŒใ€‚

2.ๆ”ฏๆŒ็ป„ไปถ

11.ๅฟซ้€Ÿๅผ€ๅง‹

ไธ‹้ขๆˆ‘ไปฌๅฐฑ้€š่ฟ‡ไธคๆฎต็ฎ€ๅ•็š„ไปฃ็ ๆฅไฝ“้ชŒไธ€ไธ‹due็š„้ญ…ๅŠ›๏ผŒLet's go~~

1.ๅฏๅŠจ็ป„ไปถ

docker-compose up

docker-compose.yamlๆ–‡ไปถๅทฒๅœจdocker็›ฎๅฝ•ไธญๅค‡ๅฅฝ๏ผŒๅฏไปฅ็›ดๆŽฅๅ–็”จ

2.่Žทๅ–ๆก†ๆžถ

go get -u github.com/dobyte/due/v2@latest
go get -u github.com/dobyte/due/locate/redis/v2@latest
go get -u github.com/dobyte/due/network/ws/v2@latest
go get -u github.com/dobyte/due/registry/consul/v2@latest
go get -u github.com/dobyte/due/transport/rpcx/v2@latest

3.ๆž„ๅปบGateๆœๅŠกๅ™จ

package main

import (
   "github.com/dobyte/due/locate/redis/v2"
   "github.com/dobyte/due/network/ws/v2"
   "github.com/dobyte/due/registry/consul/v2"
   "github.com/dobyte/due/v2"
   "github.com/dobyte/due/v2/cluster/gate"
)

func main() {
   // ๅˆ›ๅปบๅฎนๅ™จ
   container := due.NewContainer()
   // ๅˆ›ๅปบๆœๅŠกๅ™จ
   server := ws.NewServer()
   // ๅˆ›ๅปบ็”จๆˆทๅฎšไฝๅ™จ
   locator := redis.NewLocator()
   // ๅˆ›ๅปบๆœๅŠกๅ‘็Žฐ
   registry := consul.NewRegistry()
   // ๅˆ›ๅปบ็ฝ‘ๅ…ณ็ป„ไปถ
   component := gate.NewGate(
      gate.WithServer(server),
      gate.WithLocator(locator),
      gate.WithRegistry(registry),
   )
   // ๆทปๅŠ ็ฝ‘ๅ…ณ็ป„ไปถ
   container.Add(component)
   // ๅฏๅŠจๅฎนๅ™จ
   container.Serve()
}

4.ๅฏๅŠจGateๆœๅŠกๅ™จ

$ go run main.go
                    ____  __  ________
                   / __ \/ / / / ____/
                  / / / / / / / __/
                 / /_/ / /_/ / /___
                /_____/\____/_____/
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
| [Website] https://github.com/dobyte/due              |
| [Version] v2.1.0                                     |
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€Globalโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
| PID: 27159                                           |
| Mode: debug                                          |
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€Gateโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
| Name: gate                                           |
| Link: 172.22.243.151:46545                           |
| Server: [ws] 0.0.0.0:3553                            |
| Locator: redis                                       |
| Registry: consul                                     |
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

5.ๆž„ๅปบNodeๆœๅŠกๅ™จ

package main

import (
   "fmt"
   "github.com/dobyte/due/locate/redis/v2"
   "github.com/dobyte/due/registry/consul/v2"
   "github.com/dobyte/due/v2"
   "github.com/dobyte/due/v2/cluster/node"
   "github.com/dobyte/due/v2/codes"
   "github.com/dobyte/due/v2/log"
   "github.com/dobyte/due/v2/utils/xtime"
)

const greet = 1

func main() {
   // ๅˆ›ๅปบๅฎนๅ™จ
   container := due.NewContainer()
   // ๅˆ›ๅปบ็”จๆˆทๅฎšไฝๅ™จ
   locator := redis.NewLocator()
   // ๅˆ›ๅปบๆœๅŠกๅ‘็Žฐ
   registry := consul.NewRegistry()
   // ๅˆ›ๅปบ่Š‚็‚น็ป„ไปถ
   component := node.NewNode(
      node.WithLocator(locator),
      node.WithRegistry(registry),
   )
   // ๅˆๅง‹ๅŒ–็›‘ๅฌ
   initListen(component.Proxy())
   // ๆทปๅŠ ่Š‚็‚น็ป„ไปถ
   container.Add(component)
   // ๅฏๅŠจๅฎนๅ™จ
   container.Serve()
}

// ๅˆๅง‹ๅŒ–็›‘ๅฌ
func initListen(proxy *node.Proxy) {
   proxy.Router().AddRouteHandler(greet, false, greetHandler)
}

type greetReq struct {
   Message string `json:"message"`
}

type greetRes struct {
   Code    int    `json:"code"`
   Message string `json:"message"`
}

func greetHandler(ctx node.Context) {
   req := &greetReq{}
   res := &greetRes{}
   defer func() {
      if err := ctx.Response(res); err != nil {
         log.Errorf("response message failed: %v", err)
      }
   }()

   if err := ctx.Parse(req); err != nil {
      log.Errorf("parse request message failed: %v", err)
      res.Code = codes.InternalError.Code()
      return
   }

   log.Info(req.Message)

   res.Code = codes.OK.Code()
   res.Message = fmt.Sprintf("I'm server, and the current time is: %s", xtime.Now().Format(xtime.DatetimeLayout))
}

6.ๅฏๅŠจNodeๆœๅŠกๅ™จ

$ go run main.go
                    ____  __  ________
                   / __ \/ / / / ____/
                  / / / / / / / __/
                 / /_/ / /_/ / /___
                /_____/\____/_____/
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
| [Website] https://github.com/dobyte/due              |
| [Version] v2.1.0                                     |
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€Globalโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
| PID: 27390                                           |
| Mode: debug                                          |
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€Nodeโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
| Name: node                                           |
| Link: 172.22.243.151:37901                           |
| Codec: json                                          |
| Locator: redis                                       |
| Registry: consul                                     |
| Encryptor: -                                         |
| Transporter: -                                       |
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

7.ๆž„ๅปบๆต‹่ฏ•ๅฎขๆˆท็ซฏ

package main

import (
   "fmt"
   "github.com/dobyte/due/eventbus/nats/v2"
   "github.com/dobyte/due/network/ws/v2"
   "github.com/dobyte/due/v2"
   "github.com/dobyte/due/v2/cluster"
   "github.com/dobyte/due/v2/cluster/client"
   "github.com/dobyte/due/v2/eventbus"
   "github.com/dobyte/due/v2/log"
   "github.com/dobyte/due/v2/utils/xtime"
   "time"
)

const greet = 1

func main() {
   // ๅˆๅง‹ๅŒ–ไบ‹ไปถๆ€ป็บฟ
   eventbus.SetEventbus(nats.NewEventbus())
   // ๅˆ›ๅปบๅฎนๅ™จ
   container := due.NewContainer()
   // ๅˆ›ๅปบๅฎขๆˆท็ซฏ็ป„ไปถ
   component := client.NewClient(
      client.WithClient(ws.NewClient()),
   )
   // ๅˆๅง‹ๅŒ–็›‘ๅฌ
   initListen(component.Proxy())
   // ๆทปๅŠ ๅฎขๆˆท็ซฏ็ป„ไปถ
   container.Add(component)
   // ๅฏๅŠจๅฎนๅ™จ
   container.Serve()
}

// ๅˆๅง‹ๅŒ–็›‘ๅฌ
func initListen(proxy *client.Proxy) {
   // ็›‘ๅฌ็ป„ไปถๅฏๅŠจ
   proxy.AddHookListener(cluster.Start, startHandler)
   // ็›‘ๅฌ่ฟžๆŽฅๅปบ็ซ‹
   proxy.AddEventListener(cluster.Connect, connectHandler)
   // ็›‘ๅฌๆถˆๆฏๅ›žๅค
   proxy.AddRouteHandler(greet, greetHandler)
}

// ็ป„ไปถๅฏๅŠจๅค„็†ๅ™จ
func startHandler(proxy *client.Proxy) {
   if _, err := proxy.Dial(); err != nil {
      log.Errorf("gate connect failed: %v", err)
      return
   }
}

// ่ฟžๆŽฅๅปบ็ซ‹ๅค„็†ๅ™จ
func connectHandler(conn *client.Conn) {
   doPushMessage(conn)
}

// ๆถˆๆฏๅ›žๅคๅค„็†ๅ™จ
func greetHandler(ctx *client.Context) {
   res := &greetRes{}

   if err := ctx.Parse(res); err != nil {
      log.Errorf("invalid response message, err: %v", err)
      return
   }

   if res.Code != 0 {
      log.Errorf("node response failed, code: %d", res.Code)
      return
   }

   log.Info(res.Message)

   time.AfterFunc(time.Second, func() {
      doPushMessage(ctx.Conn())
   })
}

// ๆŽจ้€ๆถˆๆฏ
func doPushMessage(conn *client.Conn) {
   err := conn.Push(&cluster.Message{
      Route: 1,
      Data: &greetReq{
         Message: fmt.Sprintf("I'm client, and the current time is: %s", xtime.Now().Format(xtime.DatetimeLayout)),
      },
   })
   if err != nil {
      log.Errorf("push message failed: %v", err)
   }
}

type greetReq struct {
   Message string `json:"message"`
}

type greetRes struct {
   Code    int    `json:"code"`
   Message string `json:"message"`
}

8.ๅฏๅŠจๅฎขๆˆท็ซฏ

$ go run main.go
                    ____  __  ________
                   / __ \/ / / / ____/
                  / / / / / / / __/
                 / /_/ / /_/ / /___
                /_____/\____/_____/
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
| [Website] https://github.com/dobyte/due              |
| [Version] v2.1.0                                     |
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€Globalโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
| PID: 27801                                           |
| Mode: debug                                          |
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€Clientโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
| Name: client                                         |
| Codec: json                                          |
| Protocol: ws                                         |
| Encryptor: -                                         |
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
INFO[2024/07/03 14:53:08.969845] main.go:72 [I'm server, and the current time is: 2024-07-03 14:53:08]
INFO[2024/07/03 14:53:09.983827] main.go:72 [I'm server, and the current time is: 2024-07-03 14:53:09]
INFO[2024/07/03 14:53:10.986592] main.go:72 [I'm server, and the current time is: 2024-07-03 14:53:10]
INFO[2024/07/03 14:53:11.988530] main.go:72 [I'm server, and the current time is: 2024-07-03 14:53:11]
INFO[2024/07/03 14:53:12.991217] main.go:72 [I'm server, and the current time is: 2024-07-03 14:53:12]
INFO[2024/07/03 14:53:13.995049] main.go:72 [I'm server, and the current time is: 2024-07-03 14:53:13]

12.ๅŽ‹ๅŠ›ๆต‹่ฏ•

1.ๅŽ‹ๆต‹ๆœบๅ™จ

Ubuntu 20.04.6 LTS 13th Gen Intel(R) Core(TM) i5-13400F 16GB

2.ๅŽ‹ๆต‹็ป“ๆžœ

                    ____  __  ________
                   / __ \/ / / / ____/
                  / / / / / / / __/
                 / /_/ / /_/ / /___
                /_____/\____/_____/
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
| [Website] https://github.com/dobyte/due              |
| [Version] v2.1.0                                     |
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€Globalโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
| PID: 28660                                           |
| Mode: debug                                          |
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€Clientโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
| Name: client                                         |
| Codec: json                                          |
| Protocol: tcp                                        |
| Encryptor: -                                         |
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
server               : tcp
concurrency          : 50
latency              : 4.741343s
data size            : 1.00KB
sent requests        : 1000000
received requests    : 1000000
throughput (TPS)     : 210910
--------------------------------
server               : tcp
concurrency          : 100
latency              : 4.697039s
data size            : 1.00KB
sent requests        : 1000000
received requests    : 1000000
throughput (TPS)     : 212900
--------------------------------
server               : tcp
concurrency          : 200
latency              : 4.447127s
data size            : 1.00KB
sent requests        : 1000000
received requests    : 1000000
throughput (TPS)     : 224864
--------------------------------
server               : tcp
concurrency          : 300
latency              : 5.616742s
data size            : 1.00KB
sent requests        : 1000000
received requests    : 1000000
throughput (TPS)     : 178039
--------------------------------
server               : tcp
concurrency          : 400
latency              : 4.726411s
data size            : 1.00KB
sent requests        : 1000000
received requests    : 1000000
throughput (TPS)     : 211577
--------------------------------
server               : tcp
concurrency          : 500
latency              : 5.054949s
data size            : 1.00KB
sent requests        : 1000000
received requests    : 1000000
throughput (TPS)     : 197825
--------------------------------
server               : tcp
concurrency          : 1000
latency              : 5.486149s
data size            : 1.00KB
sent requests        : 1000000
received requests    : 1000000
throughput (TPS)     : 182277
--------------------------------
server               : tcp
concurrency          : 1000
latency              : 7.753779s
data size            : 2.00KB
sent requests        : 1000000
received requests    : 1000000
throughput (TPS)     : 128969
--------------------------------

ๆœฌๆต‹่ฏ•็ป“ๆžœไป…ไพ›ๅ‚่€ƒ๏ผŒ่ฏฆ็ป†ๆต‹่ฏ•็”จไพ‹ไปฃ็ ่ฏทๆŸฅ็œ‹due-benchmark

13.ๅ…ถไป–็ป„ไปถ

  1. ๆ—ฅๅฟ—็ป„ไปถ
    • zap: github.com/dobyte/due/log/zap/v2
    • logrus: github.com/dobyte/due/log/logrus/v2
    • aliyun: github.com/dobyte/due/log/aliyun/v2
    • tencent: github.com/dobyte/due/log/zap/v2
  2. ็ฝ‘็ปœ็ป„ไปถ
    • ws: github.com/dobyte/due/network/ws/v2
    • tcp: github.com/dobyte/due/network/tcp/v2
    • kcp: github.com/dobyte/due/network/kcp/v2
  3. ๆณจๅ†Œๅ‘็Žฐ
    • etcd: github.com/dobyte/due/registry/etcd/v2
    • consul: github.com/dobyte/due/registry/consul/v2
    • nacos: github.com/dobyte/due/registry/nacos/v2
  4. ไผ ่พ“็ป„ไปถ
    • grpc: github.com/dobyte/due/transporter/grpc/v2
    • rpcx: github.com/dobyte/due/transporter/rpcx/v2
  5. ๅฎšไฝ็ป„ไปถ
    • redis: github.com/dobyte/due/locate/redis/v2
  6. ไบ‹ไปถๆ€ป็บฟ
    • redis: github.com/dobyte/due/eventbus/redis/v2
    • nats: github.com/dobyte/due/eventbus/nats/v2
    • kafka: github.com/dobyte/due/eventbus/kafka/v2
  7. Web็ป„ไปถ
    • http: github.com/dobyte/due/component/http/v2
  8. ้…็ฝฎไธญๅฟƒ
    • etcd: github.com/dobyte/due/config/etcd/v2
    • consul: github.com/dobyte/due/config/consul/v2
    • nacos: github.com/dobyte/due/config/nacos/v2
  9. ็ผ“ๅญ˜็ป„ไปถ
    • redis: github.com/dobyte/due/cache/redis/v2

14.่ฏฆ็ป†็คบไพ‹

ๆ›ดๅคš่ฏฆ็ป†็คบไพ‹่ฏท็‚นๅ‡ปdue-examples

15.ๅ…ถไป–ๅฎขๆˆท็ซฏ

16.ไบคๆตไธŽ่ฎจ่ฎบ

ไบคๆต็พคไธชไบบไบŒ็ปด็ 

ไธชไบบๅพฎไฟก๏ผšyuebanfuxiao