custommetadata

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: MPL-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(raw map[string]interface{}, filterNils bool) (map[string]string, error)

Parse is used to effectively convert the TypeMap (map[string]interface{}) into a TypeKVPairs (map[string]string) which is how custom_metadata is stored. Defining custom_metadata as a TypeKVPairs will convert nulls into empty strings. A null, however, is essential for a PATCH operation in that it signals the handler to remove the field. The filterNils flag should only be used during a patch operation.

func Validate

func Validate(cm map[string]string) error

Validate will perform input validation for custom metadata. CustomMetadata should be arbitrary user-provided key-value pairs meant to provide supplemental information about a resource. If the key count exceeds maxKeys, the validation will be short-circuited to prevent unnecessary (and potentially costly) validation to be run. If the key count falls at or below maxKeys, multiple checks will be made per key and value. These checks include:

  • 0 < length of key <= maxKeyLength
  • 0 < length of value <= maxValueLength
  • keys and values cannot include unprintable characters

Types

This section is empty.

Jump to

Keyboard shortcuts

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