Categorygithub.com/johnsiilver/prototools
modulepackage
0.0.0-20210625191729-731bc8af3631
Repository: https://github.com/johnsiilver/prototools.git
Documentation: pkg.go.dev

# README

README

Tools for dealing with protocol buffers, especially for web apps. This is not currently stable, so pin your release if you use it.

Attributions

github.com/fatih/camelcase - We don't use the code directly, but I did take from it

# Packages

No description provided by the author

# Functions

EnumLookup generates forward and reverse lookup maps for enumerators that are in msg or any child messages.
Equal returns an empty string if the two protos are equal.
Errorf is like fmt.Errorf but with our coded error type.
FieldAsStr returns the content of the field as a string.
FQPathField extracts just the field's name.
FQPathSplit separates fqpath at ".".
GetField searches into a proto to get a field value.
GetFields takes a path that must end in a Message type and returns a list of FieldValue(s) for that message.
HumanDiff is a wrapper aound go-cmp using the protocmp.Transform.
JSONName converts the proto name of a field to the JSON equivalent.
ProtoName converts the JSON name of a field to the proto equivalent.
ReadableJSON splits the JSON field name at capital letters and titles each word.
ReadableProto slits the proto field name at "_" and titles each word.
RemovePrefix will remove the prefix word on the field name.
UpdateProtoField updates a field in a protocol buffer message with a value.

# Constants

ErrBadFieldName indicates that one the fields did not exist in the message.
ErrIntermdiateNotSet indicates that one of the intermediates messsages was nil.
ErrIntermediateNotMessage means that one of the intermediate fields was not a proto Message type.
ErrNotMessage indicates that a value in the path is not a message.
ErrUnknown means the code wasn't set.

# Structs

Error is our internal error types with error codes.
FieldValue provides the proto value of a field.
Rec is a record of the value and names for an enumeration value.

# Type aliases

ErrCode reprsents an error code.
ForwardLookup provides a map of varying spellings of an enumerator to its int32 value.
No description provided by the author
ReverseLookup provides a lookup of enumerator values to string if you know the enumerators name in proto form.