producer

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: Apache-2.0 Imports: 14 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"`
	Rights  *model.ResourceRights `json:"rights,omitempty"`
}

type DeviceGroupCommand added in v0.1.18

type DeviceGroupCommand struct {
	Command     string             `json:"command"`
	Id          string             `json:"id"`
	Owner       string             `json:"owner"`
	DeviceGroup models.DeviceGroup `json:"device_group"`
}

type HubCommand

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

type KeySeparationBalancer added in v0.0.11

type KeySeparationBalancer struct {
	SubBalancer kafka.Balancer
	Seperator   string
}

func (*KeySeparationBalancer) Balance added in v0.0.11

func (this *KeySeparationBalancer) Balance(msg kafka.Message, partitions ...int) (partition int)

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) PublishDevice added in v0.0.18

func (this *Producer) PublishDevice(device models.Device, 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) PublishDeviceGroup added in v0.1.18

func (this *Producer) PublishDeviceGroup(element models.DeviceGroup, userId string) error

func (*Producer) PublishDeviceGroupCommand added in v0.1.18

func (this *Producer) PublishDeviceGroupCommand(cmd DeviceGroupCommand) error

func (*Producer) PublishDeviceGroupDelete added in v0.1.18

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

func (*Producer) PublishDeviceRights added in v0.0.18

func (this *Producer) PublishDeviceRights(deviceId string, userId string, rights model.ResourceRights) (err error)

func (*Producer) PublishHub

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

func (*Producer) PublishHubCommand

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

func (*Producer) SendDone added in v0.0.11

func (this *Producer) SendDone(msg donewait.DoneMsg) error

Jump to

Keyboard shortcuts

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