fmt-thrift

command module
v0.0.0-...-897595c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 9 Imported by: 0

README

README

This tool can format the binary thrift message into JSON format, so that we can analyze them conveniently.

For example, typing the following command to format the input thrift message,

printf "\x80\x01\x00\x02\x00\x00\x00\x0aRpcHandler\x00\x00\x00\x01\x0c\x00\x01\x00\x02\x00\x02\x01\x0c\x00\x20\x00\x00" |\
  fmt-thrift|\
  jq .

it will output the following JSON.

{
  "1 NAME": "RpcHandler",
  "2 SEQ_ID": 1,
  "3 TYPE": "REPLY",
  "4 PAYLOAD": {
    "1 STRUCT": {},
    "2 BOOL": true,
    "32 STRUCT": {}
  }
}

How to use it

  • go1.16

    • go get github.com/xnslong/fmt-thrift
      
  • jq:

    • As this tool outputs in JSON format, jq will help a lot to display (manipulate) the result.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL