fieldmask

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllFields

func AllFields[T proto.Message]() *fieldmaskpb.FieldMask

func AsTree

func AsTree(mask *fieldmaskpb.FieldMask) art.Tree

func ByAbsence

func ByAbsence[T protoreflect.Message](msg T) *fieldmaskpb.FieldMask

func ByPresence

func ByPresence[T protoreflect.Message](msg T) *fieldmaskpb.FieldMask

func ExclusiveDiscard

func ExclusiveDiscard(msg proto.Message, mask *fieldmaskpb.FieldMask)

Recursively clears all fields except those NOT listed in the mask, such that: 1. ExclusiveDiscard(msg, ByPresence(msg)) == &T{} 2. ExclusiveDiscard(msg, ByAbsence(msg)) == msg

A nil mask is a no-op, and is not the same as a non-nil, empty mask.

func ExclusiveKeep

func ExclusiveKeep(msg proto.Message, mask *fieldmaskpb.FieldMask)

Recursively clears all fields except those listed in the mask, such that: 1. ExclusiveKeep(msg, ByPresence(msg)) == msg 2. ExclusiveKeep(msg, ByAbsence(msg)) == &T{}

A nil mask is a no-op, and is not the same as a non-nil, empty mask.

Types

This section is empty.

Jump to

Keyboard shortcuts

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