values

package
v0.0.0-...-ad90646 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBoolValue

func GetBoolValue(in *structpb.Struct, k string, required bool) (bool, error)

GetBoolValue returns a boolean value and no error if the given key is found in the provided proto struct input. An error is returned if the key is not found or the value type is not a bool.

func GetMapStringString

func GetMapStringString(in *structpb.Struct, k string, required bool) (map[string]string, error)

GetMapStringString returns a map[string]string value and no error if the given key is found in the provided proto struct input. An error is returned if the key is not found or the value type is not map[string]string.

func GetStringValue

func GetStringValue(in *structpb.Struct, k string, required bool) (string, error)

GetStringValue returns a string value and no error if the given key is found in the provided proto struct input. An error is returned if the key is not found or the value type is not a string. An error is returned if the parameter argument "required" is set to true and the value from the proto struct input is empty.

func GetTimeValue

func GetTimeValue(in *structpb.Struct, k string) (time.Time, error)

GetTimeValue returns a time.Time value and no error if the given key is found in the provided proto struct input. An error is returned if the key is not found or the value type is not a parsable. The expected time layout is RFC3339Nano.

func StructFields

func StructFields(s *structpb.Struct) map[string]struct{}

StructFields returns a map[string]struct{} of the proto struct input.

Types

This section is empty.

Jump to

Keyboard shortcuts

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