proto

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromJSON

func FromJSON(content []byte, out proto.Message) error

func FromYAML

func FromYAML(content []byte, pb proto.Message) error

func Merge

func Merge(dst, src proto.Message)

func ToYAML

func ToYAML(pb proto.Message) ([]byte, error)

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

Jump to

Keyboard shortcuts

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