fieldbehavior

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearFields

func ClearFields(message proto.Message, behaviorsToClear ...annotations.FieldBehavior)

ClearFields clears all fields annotated with any of the provided behaviors.

func CopyFields

func CopyFields(dst, src proto.Message, behaviorsToCopy ...annotations.FieldBehavior)

CopyFields copies all fields annotated with any of the provided behaviors from src to dst.

func Get

Get returns the field behavior of the provided field descriptor.

func Has

Has returns true if the provided field descriptor has the wanted field behavior.

func ValidateRequiredFields

func ValidateRequiredFields(m proto.Message) error

ValidateRequiredFields returns a validation error if any field annotated as required does not have a value. See: https://aip.dev/203

func ValidateRequiredFieldsWithMask

func ValidateRequiredFieldsWithMask(m proto.Message, mask *fieldmaskpb.FieldMask) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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