Documentation
¶
Index ¶
- Constants
- type Policy
- type PolicyRe
- type SetKV
- type Spec
- type TopicMapper
- func (k *TopicMapper) Close()
- func (k *TopicMapper) DefaultSpec() interface{}
- func (k *TopicMapper) Description() string
- func (k *TopicMapper) HandleMQTT(ctx context.MQTTContext) *context.MQTTResult
- func (k *TopicMapper) Inherit(filterSpec *pipeline.FilterSpec, previousGeneration pipeline.Filter)
- func (k *TopicMapper) Init(filterSpec *pipeline.FilterSpec)
- func (k *TopicMapper) Kind() string
- func (k *TopicMapper) Results() []string
- func (k *TopicMapper) Status() interface{}
- type TopicRe
Constants ¶
View Source
const (
// Kind is the kind of TopicMapper
Kind = "TopicMapper"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Policy ¶
type Policy struct {
Name string `yaml:"name" jsonschema:"required"`
TopicIndex int `yaml:"topicIndex" jsonschema:"required"`
Route []TopicRe `yaml:"route" jsonschema:"required"`
Headers map[int]string `yaml:"headers" jsonschema:"required"`
}
Policy describes topic map between MQTT topic and Backend MQ topic
type PolicyRe ¶
type PolicyRe struct {
Name string `yaml:"name" jsonschema:"required"`
MatchExpr string `yaml:"matchExpr" jsonschema:"required"`
}
PolicyRe to match right policy to do topic map
type SetKV ¶
type SetKV struct {
Topic string `yaml:"topic" jsonschema:"topic"`
Headers string `yaml:"headers" jsonschema:"headers"`
}
SetKV set topic mapper result to MQTT context kv map
type Spec ¶
type Spec struct {
MatchIndex int `yaml:"matchIndex" jsonschema:"required"`
Route []*PolicyRe `yaml:"route" jsonschema:"required"`
Policies []*Policy `yaml:"policies" jsonschema:"required"`
SetKV *SetKV `yaml:"setKV" jsonschema:"required"`
}
Spec is spec of Kafka
type TopicMapper ¶
type TopicMapper struct {
// contains filtered or unexported fields
}
TopicMapper map MQTT multi-level topic into topic and key-value headers
func (*TopicMapper) DefaultSpec ¶
func (k *TopicMapper) DefaultSpec() interface{}
DefaultSpec return default spec of TopicMapper
func (*TopicMapper) Description ¶
func (k *TopicMapper) Description() string
Description return description of TopicMapper
func (*TopicMapper) HandleMQTT ¶
func (k *TopicMapper) HandleMQTT(ctx context.MQTTContext) *context.MQTTResult
HandleMQTT handle MQTT context
func (*TopicMapper) Inherit ¶
func (k *TopicMapper) Inherit(filterSpec *pipeline.FilterSpec, previousGeneration pipeline.Filter)
Inherit init TopicMapper based on previous generation
func (*TopicMapper) Init ¶
func (k *TopicMapper) Init(filterSpec *pipeline.FilterSpec)
Init init TopicMapper
func (*TopicMapper) Results ¶
func (k *TopicMapper) Results() []string
Results return possible results of TopicMapper
func (*TopicMapper) Status ¶
func (k *TopicMapper) Status() interface{}
Status return status of TopicMapper
Click to show internal directories.
Click to hide internal directories.