producer

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKafkaWriter

func GetKafkaWriter(broker string, topic string, debug bool) (writer *kafka.Writer, err error)

Types

type AspectCommand

type AspectCommand struct {
	Command string        `json:"command"`
	Id      string        `json:"id"`
	Owner   string        `json:"owner"`
	Aspect  models.Aspect `json:"aspect"`
}

type DeviceCommand

type DeviceCommand struct {
	Command string        `json:"command"`
	Id      string        `json:"id"`
	Owner   string        `json:"owner"`
	Device  models.Device `json:"device"`
}

type HubCommand

type HubCommand struct {
	Command string     `json:"command"`
	Id      string     `json:"id"`
	Owner   string     `json:"owner"`
	Hub     models.Hub `json:"hub"`
}

type Producer

type Producer struct {
	// contains filtered or unexported fields
}

func New

func New(conf config.Config) (*Producer, error)

func (*Producer) PublishAspectCommand

func (this *Producer) PublishAspectCommand(cmd AspectCommand) error

func (*Producer) PublishAspectDelete

func (this *Producer) PublishAspectDelete(id string, userId string) error

func (*Producer) PublishAspectUpdate

func (this *Producer) PublishAspectUpdate(aspect models.Aspect, userId string) error

func (*Producer) PublishDeviceCommand

func (this *Producer) PublishDeviceCommand(cmd DeviceCommand) error

func (*Producer) PublishDeviceDelete

func (this *Producer) PublishDeviceDelete(id string, userId string) error

func (*Producer) PublishHub

func (this *Producer) PublishHub(hub models.Hub) (err error)

func (*Producer) PublishHubCommand

func (this *Producer) PublishHubCommand(cmd HubCommand) error

Jump to

Keyboard shortcuts

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