ES 转 Protobuf 工具 | 在线 ES 文档转 Protobuf 生成器 | GoTool在线工具集

高效后端开发工具系列 - 指南与案例

😫 核心痛点

免费在线 ES 转 Protobuf 工具,快速将 Elasticsearch 文档结构转换为 Protobuf 实体类。支持字段映射、类型自动转换、代码生成,提高开发效率。。在实际开发中,这些琐碎的转换或配置工作往往消耗大量精力且容易引入错误。GoTool 为此提供了快速、准确且免费的在线解决方案。

💡 功能亮点 & 使用方案

功能介绍

1.将 mapping 中的 properties 内容转为 struct 如下:

{
	"mappings": {
		"properties": {
			"doc_id": {
				"type": "keyword"
			},
			"id": {
				"type": "long"
			},
			"path": {
				"type": "keyword"
			},
			"name": {
				"type": "text"
			},
			"url": {
				"type": "keyword"
			},
			"description": {
				"type": "text"
			},
			"created_time": {
				"type": "date",
				"format": "yyyy-MM-dd HH:mm:ss"
			}
		}
	}
}

处理后

message Es2StructTmp {
  string created_time = 1;
  string description = 2;
  string doc_id = 3;
  int32 id = 4;
  string name = 5;
  string path = 6;
  string url = 7;
}