Discover Packages
github.com/pthethanh/nano/cmd/protoc-gen-nano
command
module
Version:
v0.0.1
Opens a new window with list of versions in this module.
Published: Aug 21, 2024
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
protoc-gen-nano
This is protobuf code generation for nano. We use protoc-gen-nano to reduce boilerplate code.
Install
go install github.com/pthethanh/nano/cmd/protoc-gen-nano
Also required:
Usage
Define your proto file normally
Generate code with option "nano_out"
Add option --nano_opt generate_gateway=true
if you want to generate the gateway registration
Register your service with nano server
LICENSE
protoc-gen-nano is a liberal reuse of protoc-gen-go hence we maintain the original license
Expand ▾
Collapse ▴
Documentation
¶
protoc-gen-nano is a plugin for the Google protocol buffer compiler to generate
Go code. Run it by building this program and putting it in your path with
the name
protoc-gen-nano
That word 'micro' at the end becomes part of the option string set for the
protocol compiler, so once the protocol compiler (protoc) is installed
you can run
protoc --nano_out=output_directory --go_out=output_directory input_directory/file.proto
to generate go-micro code for the protocol defined by file.proto.
With that input, the output will be written to
output_directory/file.nano.go
The generated code is documented in the package comment for
the library.
See the README and documentation for protocol buffers to learn more:
https://developers.google.com/protocol-buffers/
Source Files
¶
Directories
¶
internal
generator
The code generator for the plugin for the Google protocol buffer compiler.
The code generator for the plugin for the Google protocol buffer compiler.
Click to show internal directories.
Click to hide internal directories.