Documentation
¶
Index ¶
- func FromJSON(content []byte, out proto.Message) error
- func FromYAML(content []byte, pb proto.Message) error
- func Merge(dst, src proto.Message)
- func ToAnyWithValidation(msg proto.Message) (*anypb.Any, error)
- func ToYAML(pb proto.Message) ([]byte, error)
- func Validate(msg proto.Message) error
- type MergeFunction
- type OptionFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToAnyWithValidation ¶ added in v1.2.7
Types ¶
type MergeFunction ¶
type MergeFunction func(dst, src protoreflect.Message)
var ReplaceMergeFn MergeFunction = func(dst, src protoreflect.Message) { dst.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { dst.Clear(fd) return true }) src.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { dst.Set(fd, v) return true }) }
ReplaceMergeFn instead of merging all subfields one by one, takes src and set it to dest
type OptionFn ¶
type OptionFn func(options mergeOptions) mergeOptions
func MergeFunctionOptionFn ¶
func MergeFunctionOptionFn(name protoreflect.FullName, function MergeFunction) OptionFn
Click to show internal directories.
Click to hide internal directories.