Categorygithub.com/mkmik/filedescriptorset
modulepackage
0.2.0
Repository: https://github.com/mkmik/filedescriptorset.git
Documentation: pkg.go.dev

# README

filedescriptorset

go get github.com/mkmik/filedescriptorset

GoDoc

Package filedescriptorset helps you embed protobuf descriptors, and optionally their transitive dependencies.

  1. add "-odeps.bin" to your protoc command. You can also add "--include_imports" if you want to include transitively imported descriptors.

  2. create a .go file in the same dir where protoc generates code, adding this to it:

//go:generate go-bindata -modtime 1 -mode 420 -o deps.go -pkg client_model_proto3desc deps.bin

func init() { filedescriptorset.MustRegisterFileSet(MustAsset("deps.bin")) }

# Functions

MustRegisterCompressedFileSet is like RegisterCompressedFileSet but panics on error.
MustRegisterFileSet is like RegisterFileSet but panics on error.
RegisterCompressedFileSet is like RegisterFileSet but accepts a gzip compressed binary encoded FileDescriptorSet proto.
RegisterFileSet takes an uncompressed binary encoded FileDescriptorSet (usually produced by protoc --include_imports -ofile.bin).