maskpath

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package maskpath parses one update_mask path into its field segment and, for a path into a map field, the key it names (AIP-161, ADR 0075).

Only the parsing is shared. Each Service checks the field and merges the key into its own resource, since Services store resources differently.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LowerCamel

func LowerCamel(s string) string

LowerCamel converts a snake_case field name to lowerCamel. A lowerCamel name is returned unchanged.

func SnakeCase

func SnakeCase(s string) string

SnakeCase converts a lowerCamel field name to snake_case. A snake_case name is returned unchanged.

Types

type Path

type Path struct {
	// Field is the first segment, as written: snake_case or lowerCamel.
	Field string
	// Key is the map key after the field, exactly as written, without
	// backticks. It is set only when HasKey is true.
	Key    string
	HasKey bool
}

Path is one update_mask path.

func Parse

func Parse(p string) (Path, bool)

Parse splits p at its first dot. The rest is a map key: bare, or backtick-quoted so it may hold dots. Parse reports false for an empty field or key, an unbalanced quote, or segments after the key; the returned Path still holds the field segment then.

Jump to

Keyboard shortcuts

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