protoc-gen-nano

command module
v0.0.0-...-e3220b9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2023 License: MIT Imports: 5 Imported by: 0

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

  1. Define your proto file normally
  2. Generate code with option "nano_out"
  3. Add option --nano_opt generate_gateway=true if you want to generate the gateway registration
  4. Register your service with nano server

LICENSE

protoc-gen-nano is a liberal reuse of protoc-gen-go hence we maintain the original license

Documentation

Overview

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/

Directories

Path Synopsis
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL