GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - TarsCloud/TarsTup: Tars tup protocol

BranchesTags
Open more actions menu

Latest commit

 

History

28 Commits
28 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
docs-en
docs-en
 
 
docs
docs
 
 
tup-c
tup-c
 
 
tup-csharp
tup-csharp
 
 
tup-oc
tup-oc
 
 
tup-php
tup-php
 
 
tup-python
tup-python
 
 
tup-windows-cpp
tup-windows-cpp
 
 
LICENSE
LICENSE
 
 
README.en.md
README.en.md
 
 
README.md
README.md
 
 

Repository files navigation

Read in English

关于协议、Tars文件以及翻译工具的说明

TARS编码协议、TUP组包协议、TARS组包协议三者之间的关系:

  • TARS编码协议是一种数据编解码规则,它将整形、枚举值、字符串、序列、字典、自定义结构体等数据类型按照一定的规则编码到二进制数据流中。对端接收到二进制数据流之后,按照相应的规则反序列化可得到原始数值。

  • TARS编码协议使用一种叫做TAG的整型值(unsigned char)来标识变量,比如某个变量A的TAG值为100(该值由开发者自定义),我们将变量值编码的同时,也将该TAG值编码进去。对端需要读取变量A的数值时,就到数据流中寻找TAG值为100的数据段,找到后按规则读出数据部分即是变量A的数值。

  • TARS编码协议的定位是一套编码规则。tars协议序列化之后的数据不仅可以进行网络传输,同时还可以存储到数据库中。

  • TUP组包协议是TARS编码协议的上层封装,定位为通信协议。它使用变量名作为变量的关键字,编码时,客户端将变量名打包到数据流中;解码时,对端根据变量名寻找对应的数据区,然后根据数据类型对该数据区进行反序列化得到原始数值。

  • TUP组包协议内置一个TARS编码协议的Map类型,该Map的关键字就是变量名,Map的值是将变量的数据值经过TARS编码序列化的二进制数据。

  • TUP组包协议封装的数据包可以直接发送给Tars服务端,而服务端可以直接反序列化得到原始值。

  • TARS组包协议是对RequestPacket(请求结构体)和ResponsePacket(结果结构体)使用TARS编码协议封装的通信协议。结构体包含比如请求序列号、协议类型、RPC参数序列化之后二进制数据等重要信息。

About

Tars tup protocol

Topics

microservicetarstars-foundationtup

Resources

Readme
BSD-3-Clause license
Activity
Custom properties

Stars

60 stars

Watchers

2 watching

Forks

17 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.