bridge

package
v0.0.0-...-5f750f4 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//Connect mqtt connect
	Connect = "connect"
	//Publish mqtt publish
	Publish = "publish"
	//Subscribe mqtt sub
	Subscribe = "subscribe"
	//Unsubscribe mqtt sub
	Unsubscribe = "unsubscribe"
	//Disconnect mqtt disconenct
	Disconnect = "disconnect"
)
View Source
const (
	//Kafka plugin name
	Kafka = "kafka"
)

Variables

This section is empty.

Functions

func InitKafka

func InitKafka() *kafka

Init init kafak client

Types

type BridgeMQ

type BridgeMQ interface {
	Publish(e *Elements) error
}

func NewBridgeMQ

func NewBridgeMQ(name string) BridgeMQ

type Elements

type Elements struct {
	ClientID  string `json:"clientid"`
	Username  string `json:"username"`
	Topic     string `json:"topic"`
	Payload   string `json:"payload"`
	Timestamp int64  `json:"ts"`
	Size      int32  `json:"size"`
	Action    string `json:"action"`
}

Elements kafka publish elements

Jump to

Keyboard shortcuts

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