fieldmask

package
v0.95.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldMask

type FieldMask struct {
	Paths []string
}

FieldMask represents a field mask as defined in Google's Well Known Types. It is used to specify which fields of a resource should be included or excluded in a request or response.

func New

func New(paths []string) *FieldMask

New creates a FieldMask from a slice of field paths.

func (*FieldMask) EncodeValues

func (f *FieldMask) EncodeValues(key string, v *url.Values) error

EncodeValues implements the [query.Encoder] interface by encoding the field mask as a string, like "a,b,c". If the FieldMask is nil or empty, it returns nil. If the url.Values is nil, it returns an error.

func (FieldMask) MarshalJSON

func (f FieldMask) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface by formatting the field mask as a string according to Google Well Known Type

func (*FieldMask) UnmarshalJSON

func (f *FieldMask) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface by parsing the field mask from a string according to Google Well Known Type

Jump to

Keyboard shortcuts

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