construct

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetParsedValueFromAttributes

func SetParsedValueFromAttributes[T any](attrs map[string]attr.Value, key string, setter func(*T), parser func(string) (interface{}, error)) error

SetParsedValueFromAttributes sets a parsed value from the given attribute map if the key exists and is not null. It takes a map of attributes, a key to look for, a setter function to set the parsed value, and a parser function to convert the string value to the desired type. It returns an error if parsing fails.

func SetStringValueFromAttributes

func SetStringValueFromAttributes(attrs map[string]attr.Value, key string, setter func(*string))

SetStringValueFromAttributes sets a string value from the given attribute map if the key exists and is not null. It takes a map of attributes, a key to look for, and a setter function that sets the value if found.

Types

This section is empty.

Jump to

Keyboard shortcuts

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