listener

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Factories = []func(config config.Config, control Controller, securitySink SecuritySink) (topic string, listener Listener, err error){}

Functions

This section is empty.

Types

type AspectCommand

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

type CharacteristicCommand

type CharacteristicCommand struct {
	Command        string                `json:"command"`
	Id             string                `json:"id"`
	Owner          string                `json:"owner"`
	Characteristic models.Characteristic `json:"characteristic"`
}

type ConceptCommand

type ConceptCommand struct {
	Command string         `json:"command"`
	Id      string         `json:"id"`
	Owner   string         `json:"owner"`
	Concept models.Concept `json:"concept"`
}

type Controller

type Controller interface {
	SetDevice(device models.Device, owner string) error
	DeleteDevice(id string) error
	SetHub(hub models.Hub, owner string) error
	DeleteHub(id string) error
	SetDeviceType(deviceType models.DeviceType, owner string) error
	DeleteDeviceType(id string) error
	SetDeviceGroup(deviceGroup models.DeviceGroup, owner string) error
	DeleteDeviceGroup(id string) error
	SetProtocol(protocol models.Protocol, owner string) error
	DeleteProtocol(id string) error

	SetAspect(aspect models.Aspect, owner string) error
	DeleteAspect(id string) error
	SetCharacteristic(characteristic models.Characteristic, owner string) error
	DeleteCharacteristic(id string) error
	SetConcept(concept models.Concept, owner string) error
	DeleteConcept(id string) error
	SetDeviceClass(class models.DeviceClass, owner string) error
	DeleteDeviceClass(id string) error
	SetFunction(function models.Function, owner string) error
	DeleteFunction(id string) error
	SetLocation(location models.Location, owner string) error
	DeleteLocation(id string) error
	SendDone(done donewait.DoneMsg) error
}

type DeviceClassCommand

type DeviceClassCommand struct {
	Command     string             `json:"command"`
	Id          string             `json:"id"`
	Owner       string             `json:"owner"`
	DeviceClass models.DeviceClass `json:"device_class"`
}

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

type DeviceGroupCommand struct {
	Command     string                `json:"command"`
	Id          string                `json:"id"`
	Owner       string                `json:"owner"`
	DeviceGroup models.DeviceGroup    `json:"device_group"`
	Rights      *model.ResourceRights `json:"rights,omitempty"`
}

type DeviceTypeCommand

type DeviceTypeCommand struct {
	Command    string            `json:"command"`
	Id         string            `json:"id"`
	Owner      string            `json:"owner"`
	DeviceType models.DeviceType `json:"device_type"`
}

type FunctionCommand

type FunctionCommand struct {
	Command  string          `json:"command"`
	Id       string          `json:"id"`
	Owner    string          `json:"owner"`
	Function models.Function `json:"function"`
}

type HubCommand

type HubCommand struct {
	Command string                `json:"command"`
	Id      string                `json:"id"`
	Owner   string                `json:"owner"`
	Hub     models.Hub            `json:"hub"`
	Rights  *model.ResourceRights `json:"rights,omitempty"`
}

type Listener

type Listener func(msg []byte) (err error)

func AspectsListenerFactory

func AspectsListenerFactory(config config.Config, control Controller, securitySink SecuritySink) (topic string, listener Listener, err error)

func CharacteristicsListenerFactory

func CharacteristicsListenerFactory(config config.Config, control Controller, securitySink SecuritySink) (topic string, listener Listener, err error)

func ConceptsListenerFactory

func ConceptsListenerFactory(config config.Config, control Controller, securitySink SecuritySink) (topic string, listener Listener, err error)

func DeviceClassesListenerFactory

func DeviceClassesListenerFactory(config config.Config, control Controller, securitySink SecuritySink) (topic string, listener Listener, err error)

func DeviceGroupListenerFactory

func DeviceGroupListenerFactory(config config.Config, control Controller, securitySink SecuritySink) (topic string, listener Listener, err error)

func DeviceListenerFactory

func DeviceListenerFactory(config config.Config, control Controller, securitySink SecuritySink) (topic string, listener Listener, err error)

func DeviceTypeListenerFactory

func DeviceTypeListenerFactory(config config.Config, control Controller, securitySink SecuritySink) (topic string, listener Listener, err error)

func FunctionsListenerFactory

func FunctionsListenerFactory(config config.Config, control Controller, securitySink SecuritySink) (topic string, listener Listener, err error)

func HubListenerFactory

func HubListenerFactory(config config.Config, control Controller, securitySink SecuritySink) (topic string, listener Listener, err error)

func LocationsListenerFactory

func LocationsListenerFactory(config config.Config, control Controller, securitySink SecuritySink) (topic string, listener Listener, err error)

func ProtocolListenerFactory

func ProtocolListenerFactory(config config.Config, control Controller, securitySink SecuritySink) (topic string, listener Listener, err error)

type LocationCommand

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

type ProtocolCommand

type ProtocolCommand struct {
	Command  string          `json:"command"`
	Id       string          `json:"id"`
	Owner    string          `json:"owner"`
	Protocol models.Protocol `json:"protocol"`
}

type SecuritySink added in v0.0.12

type SecuritySink interface {
	EnsureInitialRights(resourceKind string, resourceId string, owner string) error
	SetRights(resourceKind string, resourceId string, rights model.ResourceRights) error
	RemoveRights(topic string, id string) error
}

Jump to

Keyboard shortcuts

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