Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeMetadata ¶
DecodeMetadata decodes a component metadata into a struct. This is an extension of mitchellh/mapstructure which also supports decoding durations.
func GetMetadataProperty ¶
GetMetadataProperty returns a property from the metadata map, with support for case-insensitive keys and aliases.
func GetMetadataPropertyWithMatchedKey ¶ added in v0.15.0
func GetMetadataPropertyWithMatchedKey(props map[string]string, keys ...string) (key string, val string, ok bool)
GetMetadataPropertyWithMatchedKey returns a property from the metadata map, with support for case-insensitive keys and aliases, while returning the original matching metadata field key.
Types ¶
type ByteSize ¶
ByteSize contains a quantity for a resource that is measured in bytes. This extends the resource.Quantity struct from k8s.io/apimachinery to add some utility methods specific for Dapr. Although the library from K8s supports other kinds of resource quantities, our focus is on sizes in bytes.
func NewByteSize ¶
NewByteSize returns a new ByteSize with a default value in bytes.
type Duration ¶
func (Duration) MarshalJSON ¶
func (Duration) ToISOString ¶
ToISOString returns the duration formatted as a ISO-8601 duration string (-ish). This methods supports days, hours, minutes, and seconds. It assumes all durations are in UTC time and are not impacted by DST (so all days are 24-hours long). This method does not support fractions of seconds, and durations are truncated to seconds. See https://en.wikipedia.org/wiki/ISO_8601#Durations for referece.
func (*Duration) UnmarshalJSON ¶
type Properties ¶ added in v0.15.0
Properties contains metadata properties, as a key-value dictionary
func (Properties) Decode ¶ added in v0.15.0
func (p Properties) Decode(result any) error
Decode decodes metadata into a struct. This is an extension of mitchellh/mapstructure which also supports decoding durations.
func (Properties) GetProperty ¶ added in v0.15.0
func (p Properties) GetProperty(keys ...string) (val string, ok bool)
GetProperty returns a property from the metadata, with support for case-insensitive keys and aliases.
func (Properties) GetPropertyWithMatchedKey ¶ added in v0.15.0
func (p Properties) GetPropertyWithMatchedKey(keys ...string) (key string, val string, ok bool)
GetPropertyWithMatchedKey returns a property from the metadata, with support for case-insensitive keys and aliases, while returning the original matching metadata field key.