Skip to content

Converts JSON to Golang, decode base64, beautify JSON, Protobuf to Typescript, etc.

Notifications You must be signed in to change notification settings

zh1gr/text-conventers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Text Conventer Text Conventer

Action From To
JSON to Golang struct
{
    "one": "two",
    "second": [
        "uno",
        "dos"
    ],
    "third": {
        "bir": 1,
        "eki": "second",
        "ush": true
    }
}
type Root struct {
	One string `json:"one"`
	Second []string `json:"second"`
	Third Third `json:"third"`
}

type Third struct {
	Bir int `json:"bir"`
	Eki string `json:"eki"`
	Ush bool `json:"ush"`
}
JSON Beautify
  {
    "one":"two","second":[
"uno", "dos"
]
     }
{
    "one": "two",
    "second": [
        "uno",
        "dos"
    ]
}
JSON Minify
{
    "one": "two",
    "second": [
        "uno",
        "dos"
    ]
}
{"one":"two","second":["uno","dos"]}
base64 to Text

SGVsbG8sIHRoaXMgaXMgYSBiYXNlNjQgZW5jb2RlZCBtZXNzYWdlLg==

Hello, this is a base64 encoded message.

ProtoBuff to TypeScript
syntax = "proto3";

package compact.complex;

enum Status {
    ACTIVE = 0;
    INACTIVE = 1;
    SUSPENDED = 2;
}

message Person {
    string name = 1;
    int32 age = 2;
    Status status = 3;
    repeated string hobbies = 4;
    map<string, string> attributes = 5;
}

message Organization {
    string name = 1;
    Person leader = 2;
    repeated Person members = 3;
    map<string, string> departments = 4;
    bool isPublic = 5;
}
enum Status {
  ACTIVE,
  INACTIVE,
  SUSPENDED,
}

interface Person {
  name: string;
  age: number;
  status: Status;
  hobbies: string[];
  attributes: Map<string, string>;
}

interface Organization {
  name: string;
  leader: Person;
  members: Person[];
  departments: Map<string, string>;
  isPublic: boolean;
}

bug

  • json to golang {"one":[[{"two":"second"}]]} return 0 0 json:"0"

future dev

  • copy/paste buttons right top text area
  • syntax highlight