Documentation ¶
Index ¶
- Constants
- func DecodeMetadata(input interface{}, result interface{}) error
- func GetMetadataProperty(props map[string]string, keys ...string) (val string, ok bool)
- func IsRawPayload(props map[string]string) (bool, error)
- func TryGetContentType(props map[string]string) (string, bool)
- func TryGetPriority(props map[string]string) (uint8, bool, error)
- func TryGetQueryIndexName(props map[string]string) (string, bool)
- func TryGetTTL(props map[string]string) (time.Duration, bool, error)
- type Base
- type Duration
Constants ¶
const ( // TTLMetadataKey defines the metadata key for setting a time to live (in seconds). TTLMetadataKey = "ttlInSeconds" // RawPayloadKey defines the metadata key for forcing raw payload in pubsub. RawPayloadKey = "rawPayload" // PriorityMetadataKey defines the metadata key for setting a priority. PriorityMetadataKey = "priority" // ContentType defines the metadata key for the content type. ContentType = "contentType" // QueryIndexName defines the metadata key for the name of query indexing schema (for redis). QueryIndexName = "queryIndexName" )
Variables ¶
This section is empty.
Functions ¶
func DecodeMetadata ¶ added in v1.9.0
func DecodeMetadata(input interface{}, result interface{}) error
DecodeMetadata decodes metadata into a struct This is an extension of mitchellh/mapstructure which also supports decoding durations
func GetMetadataProperty ¶ added in v1.9.0
GetMetadataProperty returns a property from the metadata map, with support for aliases
func IsRawPayload ¶ added in v1.2.0
IsRawPayload determines if payload should be used as-is.
func TryGetContentType ¶ added in v1.5.0
func TryGetPriority ¶
TryGetPriority tries to get the priority for binding and any other building block.
func TryGetQueryIndexName ¶ added in v1.7.0
Types ¶
type Base ¶ added in v1.9.0
type Base struct { // Name is the name of the component that's being used. Name string // Properties is the metadata properties. Properties map[string]string `json:"properties,omitempty"` }
Base is the common metadata across components. All components-specific metadata should embed this.
type Duration ¶ added in v1.2.0
func (Duration) MarshalJSON ¶ added in v1.2.0
func (Duration) ToISOString ¶ added in v1.8.0
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.