Documentation
¶
Overview ¶
Copyright (c) Microsoft Corporation. Licensed under the MIT License.
Copyright (c) Microsoft Corporation. Licensed under the MIT License.
Copyright (c) Microsoft Corporation. Licensed under the MIT License.
Index ¶
- func Concurrent[T any](concurrency uint, handler func(context.Context, T)) (func(context.Context, T), func())
- func ValidTopic(topic string) bool
- func ValidateShareName(shareName string) error
- func ValidateTopicPatternComponent(name, msgOnErr, pattern string) error
- type Timeout
- type TopicFilter
- type TopicPattern
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Concurrent ¶
func Concurrent[T any]( concurrency uint, handler func(context.Context, T), ) (func(context.Context, T), func())
Manages sending values to handlers with a configured maximum currency (where 0 indicates unlimited concurrency). Returns a function to send a value to the handlers and a cleanup function.
func ValidTopic ¶
Return whether the provided string is a fully-resolved topic.
func ValidateShareName ¶
Return whether the provided string is a valid share name.
func ValidateTopicPatternComponent ¶ added in v0.3.0
Perform initial validation of a topic pattern component.
Types ¶
type Timeout ¶
Struct to apply an optional timeout.
func (*Timeout) MessageExpiry ¶ added in v0.2.0
type TopicFilter ¶ added in v0.2.0
type TopicFilter struct {
// contains filtered or unexported fields
}
Structure to provide a topic filter that can parse out its named tokens.
func (*TopicFilter) Filter ¶ added in v0.2.0
func (tf *TopicFilter) Filter() string
Filter provides the MQTT topic filter string.
type TopicPattern ¶
type TopicPattern struct {
// contains filtered or unexported fields
}
Structure to apply tokens to a named topic pattern.
func NewTopicPattern ¶
func NewTopicPattern( name, pattern string, tokens map[string]string, namespace string, ) (*TopicPattern, error)
Create a new topic pattern and perform initial validations.
func (*TopicPattern) Filter ¶
func (tp *TopicPattern) Filter() (*TopicFilter, error)
Generate a filter for subscribing. Unresolved tokens are treated as "+" wildcards for this purpose.