environment

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBroker

func GetBroker(zk string) (brokers []string, err error)

Types

type Device

type Device struct {
	Id           string `json:"id"`
	LocalId      string `json:"local_id"`
	Name         string `json:"name"`
	DeviceTypeId string `json:"device_type_id"`
}

type DeviceCommand

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

type Location

type Location struct {
	Id             string   `json:"id"`
	Name           string   `json:"name"`
	Description    string   `json:"description"`
	Image          string   `json:"image"`
	DeviceIds      []string `json:"device_ids"`
	DeviceGroupIds []string `json:"device_group_ids"`
	RdfType        string   `json:"rdf_type"`
}

type LocationCommand

type LocationCommand struct {
	Command  string   `json:"command"`
	Id       string   `json:"id"`
	Owner    string   `json:"owner"`
	Location Location `json:"location"`
}

type Publisher

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

func New

func New(ctx context.Context, wg *sync.WaitGroup) (repoUrl string, publisher *Publisher, err error)

func NewPublisher

func NewPublisher(zkUrl string, deviceTopic string, locationTopic string) (*Publisher, error)

func (*Publisher) PublishDevice

func (this *Publisher) PublishDevice(device Device, userId string) (err error)

func (*Publisher) PublishDeviceCommand

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

func (*Publisher) PublishDeviceDelete

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

func (*Publisher) PublishLocation

func (this *Publisher) PublishLocation(Location Location, userId string) (err error)

func (*Publisher) PublishLocationCommand

func (this *Publisher) PublishLocationCommand(cmd LocationCommand) error

func (*Publisher) PublishLocationDelete

func (this *Publisher) PublishLocationDelete(id string, userId string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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