filedescriptorset

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2019 License: MIT Imports: 5 Imported by: 0

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")) }

Documentation

Overview

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")) }

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustRegisterCompressedFileSet

func MustRegisterCompressedFileSet(b []byte)

MustRegisterCompressedFileSet is like RegisterCompressedFileSet but panics on error. This can be useful in global or func init() initializers.

func MustRegisterFileSet

func MustRegisterFileSet(b []byte)

MustRegisterFileSet is like RegisterFileSet but panics on error. This can be useful in global or func init() initializers.

func RegisterCompressedFileSet

func RegisterCompressedFileSet(b []byte) error

RegisterCompressedFileSet is like RegisterFileSet but accepts a gzip compressed binary encoded FileDescriptorSet proto.

func RegisterFileSet

func RegisterFileSet(b []byte) error

RegisterFileSet takes an uncompressed binary encoded FileDescriptorSet (usually produced by protoc --include_imports -ofile.bin).

Types

This section is empty.

Jump to

Keyboard shortcuts

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