{"repo":"moul/protoc-gen-gotemplate","free":true,"listed":false,"github":"https://github.com/moul/protoc-gen-gotemplate","clone":"git clone https://github.com/moul/protoc-gen-gotemplate.git","description":":open_file_folder: generic protocol generator based on golang's text/template (grpc/protobuf)","language":"Go","stars":441,"topics":["golang","protobuf","code-generator","generator","ast","protoc"],"license":"MIT","category":"dev-tools","readme_excerpt":"protoc-gen-gotemplate :open file folder: protocol generator + golang text/template (protobuf) A generic code /script/data generator based on Protobuf. --- This project is a generator plugin for the Google Protocol Buffers compiler ( protoc ). The plugin parses protobuf files, generates an ast , and walks a local templates directory to generate files using the Golang's text/template engine. Philosophy protobuf-first no built-in template, only user defined templates kiss, keep it stupid simple Under the hood 1. the user protobuf files are parsed by protoc 2. the ast is generated by protoc-gen-go helpers 3. the ast is given to Golang's text/template engine for each user template files 4. the funcmap enriching the template engine is based on Masterminds/sprig, and contains type-manipulation, iteration and language-specific helpers Dev helpers 1. Pre-commit script for install: https://pre-commit.com Web editor Demo server Usage protoc-gen-gotemplate requires a template dir directory (by default ./templates ) . Every file ending with .tmpl will be processed and written to the destination folder, following the file hierarchy of the template dir , and remove the .tmpl extension. --- Options You can specify custom options, as follow: Option Default Value Accepted Values Description ----------------------- --------------- --------------------------- ----------------------- template dir ./template absolute or relative path path to look for templates destination dir . absolute or relativ","default_branch":null,"files":null,"tree":[],"storefront":"/r/moul","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/moul/protoc-gen-gotemplate/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}