protoveneer

command
v0.0.0-...-be819d1 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Overview

protoveneer generates idiomatic Go types that correspond to protocol buffer messages and enums -- a veneer on top of the proto layer.

Relationship to GAPICs

GAPICs and this tool complement each other.

GAPICs have client types and idiomatic methods on them that correspond to RPCs. They focus on the RPC part of a service. A GAPIC relies on the underlying protocol buffer types for the request and response types, and all the types that these refer to.

protoveener generates Go types that correspond to proto messages and enums, including requests and responses if desired. It doesn't touch the RPC parts of the proto definition.

Configuration

protoveneer requires significant configuration to produce good results. See the config type in config.go and the config.yaml files in the testdata subdirectories to understand how to write configuration.

Support functions

protoveneer generates code that relies on a few support functions. These live in the support subdirectory. You should copy the contents of this directory to a location of your choice, and add "supportImportPath" to your config to refer to that directory's import path.

Unhandled features

There is no support for oneofs. Omit the oneof type and write custom code. However, the types of the individual oneof cases can be generated.

Jump to

Keyboard shortcuts

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