topicmapper

package
v1.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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) Close

func (k *TopicMapper) Close()

Close close TopicMapper

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) Kind

func (k *TopicMapper) Kind() string

Kind return kind of 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

type TopicRe

type TopicRe struct {
	Topic string   `yaml:"topic" jsonschema:"required"`
	Exprs []string `yaml:"exprs" jsonschema:"required"`
}

TopicRe to match right topic in given policy

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL