fieldmask

package
v0.67.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 5 Imported by: 4

Documentation

Overview

Package fieldmask provides primitives for implementing AIP field mask functionality.

This package only provides primitives not already provided by the package google.golang.org/protobuf/types/known/fieldmaskpb.

See: https://google.aip.dev/134 (Standard methods: Update) See: https://google.aip.dev/157 (Partial responses)

Index

Constants

View Source
const WildcardPath = "*"

WildcardPath is the path used for update masks that should perform a full replacement.

Variables

This section is empty.

Functions

func IsFullReplacement added in v0.38.0

func IsFullReplacement(fm *fieldmaskpb.FieldMask) bool

IsFullReplacement reports whether a field mask contains the special wildcard path, meaning full replacement (the equivalent of PUT).

func Update added in v0.23.0

func Update(mask *fieldmaskpb.FieldMask, dst, src proto.Message)

Update updates fields in dst with values from src according to the provided field mask. Nested messages are recursively updated in the same manner. Repeated fields and maps are copied by reference from src to dst. Field mask paths referring to Individual entries in maps or repeated fields are ignored.

If no update mask is provided, only non-zero values of src are copied to dst. If the special value "*" is provided as the field mask, a full replacement of all fields in dst is done.

See: https://google.aip.dev/134 (Standard methods: Update).

func Validate added in v0.13.0

func Validate(fm *fieldmaskpb.FieldMask, m proto.Message) error

Validate validates that the paths in the provided field mask are syntactically valid and refer to known fields in the specified message type.

Types

This section is empty.

Jump to

Keyboard shortcuts

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