protoc-gen-go-methodoptions

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

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

Go to latest
Published: Sep 13, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

README

protoc-gen-go-methodoptions

Table of Contents

About

This is a protoc plugin that generates Go code for the google.protobuf.MethodOptions message type. This allows you to write your own custom options for your gRPC services, and provides a few ways to access them (constants, request methods, and service methods).

Getting Started

Prerequisites

What things you need to install the software and how to install them.

Give examples
Installing
go install github.com/taylow/protoc-gen-go-methodoptions@latest
Generate
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative --go-methodoptions_out=. --go-methodoptions_opt=paths=source_relative example/service.proto

Usage

This system was developed while working at Comnoco and is used to allow us to add custom options to our gRPC services. We use this to define our authorisation roles at the proto level, allowing both the frontend and backend to use the same authorisation rules. A full example of this can be found in the example directory.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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