Documentation ¶
Overview ¶
Package topicmapper maps MQTT topic to Kafka topics and key-value headers
Index ¶
- Constants
- type Policy
- type PolicyRe
- type SetKV
- type Spec
- type TopicMapper
- func (k *TopicMapper) Close()
- func (k *TopicMapper) Handle(ctx *context.Context) string
- func (k *TopicMapper) Inherit(previousGeneration filters.Filter)
- func (k *TopicMapper) Init()
- func (k *TopicMapper) Kind() *filters.Kind
- func (k *TopicMapper) Name() string
- func (k *TopicMapper) Spec() filters.Spec
- 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 `json:"name" jsonschema:"required"` TopicIndex int `json:"topicIndex" jsonschema:"required"` Route []TopicRe `json:"route" jsonschema:"required"` Headers map[int]string `json:"headers" jsonschema:"required"` }
Policy describes topic map between MQTT topic and Backend MQ topic
type PolicyRe ¶
type PolicyRe struct { Name string `json:"name" jsonschema:"required"` MatchExpr string `json:"matchExpr" jsonschema:"required"` }
PolicyRe to match right policy to do topic map
type SetKV ¶
type SetKV struct { Topic string `json:"topic" jsonschema:"topic"` Headers string `json:"headers" jsonschema:"headers"` }
SetKV set topic mapper result to MQTT context kv map
type Spec ¶
type Spec struct { filters.BaseSpec `json:",inline"` MatchIndex int `json:"matchIndex" jsonschema:"required"` Route []*PolicyRe `json:"route" jsonschema:"required"` Policies []*Policy `json:"policies" jsonschema:"required"` SetKV *SetKV `json:"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) Handle ¶
func (k *TopicMapper) Handle(ctx *context.Context) string
Handle handle context
func (*TopicMapper) Inherit ¶
func (k *TopicMapper) Inherit(previousGeneration filters.Filter)
Inherit init TopicMapper based on previous generation
func (*TopicMapper) Kind ¶
func (k *TopicMapper) Kind() *filters.Kind
Kind return kind of TopicMapper
func (*TopicMapper) Name ¶
func (k *TopicMapper) Name() string
Name returns the name of the TopicMapper filter instance.
func (*TopicMapper) Spec ¶
func (k *TopicMapper) Spec() filters.Spec
Spec returns the spec used by the TopicMapper
func (*TopicMapper) Status ¶
func (k *TopicMapper) Status() interface{}
Status return status of TopicMapper
Click to show internal directories.
Click to hide internal directories.