Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReparseUnrecognized ¶ added in v1.10.0
func ReparseUnrecognized(resolver Resolver, reflectMessage protoreflect.Message) error
ReparseUnrecognized uses the given resolver to parse any unrecognized fields in the given reflectMessage. It does so recursively, resolving any unrecognized fields in nested messages.
Types ¶
type Marshaler ¶
Marshaler marshals Messages.
func NewJSONMarshaler ¶
NewJSONMarshaler returns a new Marshaler for JSON.
This has the potential to be unstable over time. resolver can be nil if unknown and are only needed for extensions.
func NewJSONMarshalerIndent ¶
NewJSONMarshalerIndent returns a new Marshaler for JSON with indents.
This has the potential to be unstable over time. resolver can be nil if unknown and are only needed for extensions.
func NewJSONMarshalerUseProtoNames ¶
NewJSONMarshalerUseProtoNames returns a new Marshaler for JSON using the proto names for keys.
This has the potential to be unstable over time. resolver can be nil if unknown and are only needed for extensions.
func NewWireMarshaler ¶
func NewWireMarshaler() Marshaler
NewWireMarshaler returns a new Marshaler for wire.
See https://godoc.org/google.golang.org/protobuf/proto#MarshalOptions for a discussion on stability. This has the potential to be unstable over time.
type Resolver ¶
type Resolver interface { protoregistry.ExtensionTypeResolver protoregistry.MessageTypeResolver }
Resolver is a Resolver.
This is only needed in cases where extensions may be present.
func NewLazyResolver ¶ added in v1.10.0
func NewLazyResolver(fileDescriptors ...protodescriptor.FileDescriptor) Resolver
NewLazyResolver creates a new Resolver that is constructed from the given descriptors only as needed, if invoked.
If there is an error when constructing the resolver, it will be returned by all method calls of the returned resolver.
func NewResolver ¶
func NewResolver(fileDescriptors ...protodescriptor.FileDescriptor) (Resolver, error)
NewResolver creates a new Resolver.
If the input slice is empty, this returns nil The given FileDescriptors must be self-contained, that is they must contain all imports. This can NOT be guaranteed for FileDescriptorSets given over the wire, and can only be guaranteed from builds.
type Unmarshaler ¶
Unmarshaler unmarshals Messages.
func NewJSONUnmarshaler ¶
func NewJSONUnmarshaler(resolver Resolver) Unmarshaler
NewJSONUnmarshaler returns a new Unmarshaler for json.
resolver can be nil if unknown and are only needed for extensions.
func NewWireUnmarshaler ¶
func NewWireUnmarshaler(resolver Resolver) Unmarshaler
NewWireUnmarshaler returns a new Unmarshaler for wire.
resolver can be nil if unknown and are only needed for extensions.