pb

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeProtobufToJSON

func DecodeProtobufToJSON(readOpts *opts.ReadOptions, fds *dpb.FileDescriptorSet, message []byte) ([]byte, error)

DecodeProtobufToJSON is a wrapper for decoding/unmarshalling []byte of protobuf into a dynamic.Message and then marshalling that into JSON.

func FindMessageDescriptorInFDS added in v1.0.0

func FindMessageDescriptorInFDS(fds *dpb.FileDescriptorSet, messageName string) (*desc.MessageDescriptor, error)

func GetAllMessageDescriptorsInFDS added in v1.8.0

func GetAllMessageDescriptorsInFDS(fds *dpb.FileDescriptorSet) ([]*desc.FileDescriptor, error)

GetAllMessageDescriptorsInFDS returns all file descriptors from a set. The slice of descriptors is used for dynamic.AnyResolver to handle google.protobuf.Any typed fields

func ProcessDescriptors added in v1.8.0

func ProcessDescriptors(pbDirs []string, fdsFile string) (*dpb.FileDescriptorSet, error)

ProcessDescriptors will return a protobuf file descriptor set that is generated from either a bunch of .proto files in a directory, or directly from a .fds/.protoset file

Types

type MDType added in v1.0.4

type MDType string

MDType is used for type safety on message descriptor maps used in protobuf functions

var (
	MDEnvelope MDType = "envelope"
	MDPayload  MDType = "payload"
)

Jump to

Keyboard shortcuts

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