Documentation ¶
Index ¶
- func GetBoolValue(in *structpb.Struct, k string, required bool) (bool, error)
- func GetMapStringString(in *structpb.Struct, k string, required bool) (map[string]string, error)
- func GetStringValue(in *structpb.Struct, k string, required bool) (string, error)
- func GetTimeValue(in *structpb.Struct, k string) (time.Time, error)
- func StructFields(s *structpb.Struct) map[string]struct{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBoolValue ¶
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 ¶ added in v0.1.7
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 ¶
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 ¶
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 ¶
StructFields returns a map[string]struct{} of the proto struct input.
Types ¶
This section is empty.