Giter Site home page Giter Site logo

protoplus's Introduction

protoplus

通用的描述文件及代码生成器及工具集

特性

  • 提供比Protobuf描述文件更加友好的格式

  • 支持插件架构,可以使用任何语言开发自己的协议runtime和代码生成器

  • 插件信息交换使用JSON格式(Protobuf使用pb二进制格式)

描述文件格式(*.pp)


enum Vocation {
	Monkey
	Monk
	Pig
}

struct PhoneNumber {

	number string

	type int32
}


struct Person {

	name string

	id  int32

	email string

	phone PhoneNumber

	voc Vocation
}

struct AddressBook {

	person []Person
}


特性

  • 自动生成tag序列号(base0),也可以手动指定

  • 自动生成枚举序号(base0),也可以手动指定

  • 类go结构体字段命名方式

  • 比Protobuf更方便的导出注释内容做协议扩充

支持类型

  • int32: 32位整形
  • int64: 64位整形
  • uint32: 无符号32位整形
  • uint64: 无符号64位整形
  • string: 字符串
  • float32: 单精度浮点数
  • float64: 双精度浮点数
  • bytes: 二进制数据
  • enum: int32封装
  • bool: 布尔
  • struct 结构体

所有类型前添加[]表示数组

编译

	go get -u -v github.com/davyxu/protoplus

下载

命令行参数

使用方法

备注

感觉不错请star, 谢谢!

开源讨论群: 527430600

知乎: http://www.zhihu.com/people/sunicdavy

提交bug及特性: https://github.com/davyxu/protoplus/issues

protoplus's People

Contributors

davyxu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.