bridge

package
v0.0.0-...-f0a05f1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Connect     = "connect"
	Publish     = "publish"
	Subscribe   = "subscribe"
	Unsubscribe = "unsubscribe"
	Disconnect  = "disconnect"
)

Variables

This section is empty.

Functions

func NewKafka

func NewKafka(config *KafkaConfig) (*kafka, error)

Types

type Bridge

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

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"`
}

type KafkaConfig

type KafkaConfig struct {
	Addr             []string          `json:"addr"`
	ConnectTopic     string            `json:"onConnect"`
	SubscribeTopic   string            `json:"onSubscribe"`
	PublishTopic     string            `json:"onPublish"`
	UnsubscribeTopic string            `json:"onUnsubscribe"`
	DisconnectTopic  string            `json:"onDisconnect"`
	DeliverMap       map[string]string `json:"deliverMap"`
}

Jump to

Keyboard shortcuts

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