Documentation ¶
Index ¶
- type Com
- type Controller
- func (this *Controller) DeleteUser(userId string) error
- func (this *Controller) DeviceLocalIdToId(token auth.Token, localId string) (id string, err error, errCode int)
- func (this *Controller) GetPublisher() Publisher
- func (this *Controller) PublishAspectCreate(token auth.Token, aspect models.Aspect) (models.Aspect, error, int)
- func (this *Controller) PublishAspectDelete(token auth.Token, id string) (error, int)
- func (this *Controller) PublishAspectUpdate(token auth.Token, id string, aspect models.Aspect) (models.Aspect, error, int)
- func (this *Controller) PublishCharacteristicCreate(token auth.Token, characteristic models.Characteristic) (models.Characteristic, error, int)
- func (this *Controller) PublishCharacteristicDelete(token auth.Token, id string) (error, int)
- func (this *Controller) PublishCharacteristicUpdate(token auth.Token, characteristicId string, ...) (models.Characteristic, error, int)
- func (this *Controller) PublishConceptCreate(token auth.Token, concept models.Concept) (models.Concept, error, int)
- func (this *Controller) PublishConceptDelete(token auth.Token, id string) (error, int)
- func (this *Controller) PublishConceptUpdate(token auth.Token, id string, concept models.Concept) (models.Concept, error, int)
- func (this *Controller) PublishDeviceClassCreate(token auth.Token, deviceClass models.DeviceClass) (models.DeviceClass, error, int)
- func (this *Controller) PublishDeviceClassDelete(token auth.Token, id string) (error, int)
- func (this *Controller) PublishDeviceClassUpdate(token auth.Token, id string, deviceClass models.DeviceClass) (models.DeviceClass, error, int)
- func (this *Controller) PublishDeviceCreate(token auth.Token, device models.Device) (models.Device, error, int)
- func (this *Controller) PublishDeviceDelete(token auth.Token, id string) (error, int)
- func (this *Controller) PublishDeviceGroupCreate(token auth.Token, dg models.DeviceGroup) (result models.DeviceGroup, err error, code int)
- func (this *Controller) PublishDeviceGroupDelete(token auth.Token, id string) (error, int)
- func (this *Controller) PublishDeviceGroupUpdate(token auth.Token, id string, dg models.DeviceGroup) (result models.DeviceGroup, err error, code int)
- func (this *Controller) PublishDeviceTypeCreate(token auth.Token, dt models.DeviceType) (models.DeviceType, error, int)
- func (this *Controller) PublishDeviceTypeDelete(token auth.Token, id string) (error, int)
- func (this *Controller) PublishDeviceTypeUpdate(token auth.Token, id string, dt models.DeviceType) (models.DeviceType, error, int)
- func (this *Controller) PublishDeviceUpdate(token auth.Token, id string, device models.Device, ...) (_ models.Device, err error, code int)
- func (this *Controller) PublishFunctionCreate(token auth.Token, function models.Function) (models.Function, error, int)
- func (this *Controller) PublishFunctionDelete(token auth.Token, id string) (error, int)
- func (this *Controller) PublishFunctionUpdate(token auth.Token, id string, function models.Function) (models.Function, error, int)
- func (this *Controller) PublishHubCreate(token auth.Token, hubEdit models.HubEdit) (models.Hub, error, int)
- func (this *Controller) PublishHubDelete(token auth.Token, id string) (error, int)
- func (this *Controller) PublishHubUpdate(token auth.Token, id string, userId string, hubEdit models.HubEdit) (models.Hub, error, int)
- func (this *Controller) PublishLocationCreate(token auth.Token, location models.Location) (result models.Location, err error, code int)
- func (this *Controller) PublishLocationDelete(token auth.Token, id string) (error, int)
- func (this *Controller) PublishLocationUpdate(token auth.Token, id string, location models.Location) (models.Location, error, int)
- func (this *Controller) PublishProtocolCreate(token auth.Token, protocol models.Protocol) (models.Protocol, error, int)
- func (this *Controller) PublishProtocolDelete(token auth.Token, id string) (error, int)
- func (this *Controller) PublishProtocolUpdate(token auth.Token, id string, protocol models.Protocol) (models.Protocol, error, int)
- func (this *Controller) ReadAspect(token auth.Token, id string) (aspect models.Aspect, err error, code int)
- func (this *Controller) ReadCharacteristic(token auth.Token, id string) (result models.Characteristic, err error, code int)
- func (this *Controller) ReadConcept(token auth.Token, id string) (concept models.Concept, err error, code int)
- func (this *Controller) ReadDevice(token auth.Token, id string) (device models.Device, err error, code int)
- func (this *Controller) ReadDeviceClass(token auth.Token, id string) (deviceClass models.DeviceClass, err error, code int)
- func (this *Controller) ReadDeviceGroup(token auth.Token, id string) (dt models.DeviceGroup, err error, code int)
- func (this *Controller) ReadDeviceType(token auth.Token, id string) (dt models.DeviceType, err error, code int)
- func (this *Controller) ReadFunction(token auth.Token, id string) (function models.Function, err error, code int)
- func (this *Controller) ReadHub(token auth.Token, id string) (hub models.Hub, err error, code int)
- func (this *Controller) ReadLocation(token auth.Token, id string) (location models.Location, err error, code int)
- func (this *Controller) ReadProtocol(token auth.Token, id string) (protocol models.Protocol, err error, code int)
- func (this *Controller) ValidateDistinctDeviceTypeAttributes(token auth.Token, devicetype models.DeviceType, attributeKeys []string) error
- type IdWrapper
- type Publisher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Com ¶
type Com interface { ResourcesEffectedByUserDelete(token auth.Token, resource string) (deleteResourceIds []string, deleteUserFromResourceIds []string, err error) GetResourceOwner(token auth.Token, kind string, id string, rights string) (owner string, found bool, err error) GetPermissions(token auth.Token, kind string, id string) (permmodel.ResourceRights, error) GetTechnicalDeviceGroup(token auth.Token, id string) (dt models.DeviceGroup, err error, code int) ValidateDeviceGroup(token auth.Token, dt models.DeviceGroup) (err error, code int) PermissionCheckForDeviceGroup(token auth.Token, id string, permission string) (err error, code int) //permission = "w" | "r" | "x" | "a" GetDeviceType(token auth.Token, id string) (dt models.DeviceType, err error, code int) ValidateDeviceType(token auth.Token, dt models.DeviceType) (err error, code int) PermissionCheckForDeviceType(token auth.Token, id string, permission string) (err error, code int) //permission = "w" | "r" | "x" | "a" GetProtocol(token auth.Token, id string) (models.Protocol, error, int) ValidateProtocol(token auth.Token, protocol models.Protocol) (err error, code int) GetDevice(token auth.Token, id string) (models.Device, error, int) //uses internal admin jwt ValidateDevice(token auth.Token, device models.Device) (err error, code int) PermissionCheckForDevice(token auth.Token, id string, permission string) (err error, code int) //permission = "w" | "r" | "x" | "a" PermissionCheckForDeviceList(token auth.Token, ids []string, rights string) (result map[string]bool, err error, code int) GetHub(token auth.Token, id string) (models.Hub, error, int) //uses internal admin jwt ValidateHub(token auth.Token, hub models.Hub) (err error, code int) PermissionCheckForHub(token auth.Token, id string, permission string) (err error, code int) //permission = "w" | "r" | "x" | "a" GetConcept(token auth.Token, id string) (models.Concept, error, int) ValidateConcept(token auth.Token, concept models.Concept) (err error, code int) PermissionCheckForConcept(token auth.Token, id string, permission string) (err error, code int) //permission = "w" | "r" | "x" | "a" ValidateCharacteristic(token auth.Token, concept models.Characteristic) (err error, code int) PermissionCheckForCharacteristic(token auth.Token, id string, permission string) (err error, code int) //permission = "w" | "r" | "x" | "a" GetCharacteristic(token auth.Token, id string) (concept models.Characteristic, err error, code int) DevicesOfTypeExist(token auth.Token, deviceTypeId string) (result bool, err error, code int) DeviceLocalIdToId(token auth.Token, localId string) (id string, err error, code int) GetAspect(token auth.Token, id string) (models.Aspect, error, int) ValidateAspect(token auth.Token, aspect models.Aspect) (err error, code int) GetFunction(token auth.Token, id string) (models.Function, error, int) ValidateFunction(token auth.Token, function models.Function) (err error, code int) GetDeviceClass(token auth.Token, id string) (models.DeviceClass, error, int) ValidateDeviceClass(token auth.Token, deviceClass models.DeviceClass) (err error, code int) GetLocation(token auth.Token, id string) (models.Location, error, int) ValidateLocation(token auth.Token, Location models.Location) (err error, code int) PermissionCheckForLocation(token auth.Token, id string, permission string) (err error, code int) //permission = "w" | "r" | "x" | "a" ValidateAspectDelete(token auth.Token, id string) (err error, code int) ValidateCharacteristicDelete(token auth.Token, id string) (err error, code int) ValidateConceptDelete(token auth.Token, id string) (err error, code int) ValidateDeviceClassDelete(token auth.Token, id string) (err error, code int) ValidateFunctionDelete(token auth.Token, id string) (err error, code int) QueryPermissionsSearch(token string, query com.QueryMessage, result interface{}) (err error, code int) }
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewWithPublisher ¶
func NewWithPublisher(conf config.Config, publisher Publisher) (*Controller, error)
func (*Controller) DeleteUser ¶
func (this *Controller) DeleteUser(userId string) error
func (*Controller) DeviceLocalIdToId ¶
func (*Controller) GetPublisher ¶
func (this *Controller) GetPublisher() Publisher
func (*Controller) PublishAspectCreate ¶
func (*Controller) PublishAspectDelete ¶
func (*Controller) PublishAspectUpdate ¶
func (*Controller) PublishCharacteristicCreate ¶
func (this *Controller) PublishCharacteristicCreate(token auth.Token, characteristic models.Characteristic) (models.Characteristic, error, int)
func (*Controller) PublishCharacteristicDelete ¶
func (*Controller) PublishCharacteristicUpdate ¶
func (this *Controller) PublishCharacteristicUpdate(token auth.Token, characteristicId string, characteristic models.Characteristic) (models.Characteristic, error, int)
func (*Controller) PublishConceptCreate ¶
func (*Controller) PublishConceptDelete ¶
func (*Controller) PublishConceptUpdate ¶
func (*Controller) PublishDeviceClassCreate ¶
func (this *Controller) PublishDeviceClassCreate(token auth.Token, deviceClass models.DeviceClass) (models.DeviceClass, error, int)
func (*Controller) PublishDeviceClassDelete ¶
func (*Controller) PublishDeviceClassUpdate ¶
func (this *Controller) PublishDeviceClassUpdate(token auth.Token, id string, deviceClass models.DeviceClass) (models.DeviceClass, error, int)
func (*Controller) PublishDeviceCreate ¶
func (*Controller) PublishDeviceDelete ¶
func (*Controller) PublishDeviceGroupCreate ¶
func (this *Controller) PublishDeviceGroupCreate(token auth.Token, dg models.DeviceGroup) (result models.DeviceGroup, err error, code int)
func (*Controller) PublishDeviceGroupDelete ¶
func (*Controller) PublishDeviceGroupUpdate ¶
func (this *Controller) PublishDeviceGroupUpdate(token auth.Token, id string, dg models.DeviceGroup) (result models.DeviceGroup, err error, code int)
func (*Controller) PublishDeviceTypeCreate ¶
func (this *Controller) PublishDeviceTypeCreate(token auth.Token, dt models.DeviceType) (models.DeviceType, error, int)
func (*Controller) PublishDeviceTypeDelete ¶
func (*Controller) PublishDeviceTypeUpdate ¶
func (this *Controller) PublishDeviceTypeUpdate(token auth.Token, id string, dt models.DeviceType) (models.DeviceType, error, int)
func (*Controller) PublishDeviceUpdate ¶
func (this *Controller) PublishDeviceUpdate(token auth.Token, id string, device models.Device, options model.DeviceUpdateOptions) (_ models.Device, err error, code int)
admins may create new devices but only without setting options.UpdateOnlySameOriginAttributes
func (*Controller) PublishFunctionCreate ¶
func (*Controller) PublishFunctionDelete ¶
func (*Controller) PublishFunctionUpdate ¶
func (*Controller) PublishHubCreate ¶
func (*Controller) PublishHubDelete ¶
func (*Controller) PublishHubUpdate ¶
func (*Controller) PublishLocationCreate ¶
func (*Controller) PublishLocationDelete ¶
func (*Controller) PublishLocationUpdate ¶
func (*Controller) PublishProtocolCreate ¶
func (*Controller) PublishProtocolDelete ¶
func (*Controller) PublishProtocolUpdate ¶
func (*Controller) ReadAspect ¶
func (*Controller) ReadCharacteristic ¶
func (this *Controller) ReadCharacteristic(token auth.Token, id string) (result models.Characteristic, err error, code int)
func (*Controller) ReadConcept ¶
func (*Controller) ReadDevice ¶
func (*Controller) ReadDeviceClass ¶
func (this *Controller) ReadDeviceClass(token auth.Token, id string) (deviceClass models.DeviceClass, err error, code int)
func (*Controller) ReadDeviceGroup ¶
func (this *Controller) ReadDeviceGroup(token auth.Token, id string) (dt models.DeviceGroup, err error, code int)
func (*Controller) ReadDeviceType ¶
func (this *Controller) ReadDeviceType(token auth.Token, id string) (dt models.DeviceType, err error, code int)
func (*Controller) ReadFunction ¶
func (*Controller) ReadLocation ¶
func (*Controller) ReadProtocol ¶
func (*Controller) ValidateDistinctDeviceTypeAttributes ¶
func (this *Controller) ValidateDistinctDeviceTypeAttributes(token auth.Token, devicetype models.DeviceType, attributeKeys []string) error
type Publisher ¶
type Publisher interface { PublishDevice(device models.Device, userID string) (err error) PublishDeviceDelete(id string, userID string) error PublishDeviceType(device models.DeviceType, userID string) (err error) PublishDeviceTypeDelete(id string, userID string) error PublishDeviceGroup(device models.DeviceGroup, userID string) (err error) PublishDeviceGroupDelete(id string, userID string) error PublishProtocol(device models.Protocol, userID string) (err error) PublishProtocolDelete(id string, userID string) error PublishHub(hub models.Hub, userID string) (err error) PublishHubDelete(id string, userID string) error PublishConcept(concept models.Concept, userID string) (err error) PublishConceptDelete(id string, userID string) error PublishCharacteristic(characteristic models.Characteristic, userID string) (err error) PublishCharacteristicDelete(id string, userID string) error PublishAspect(device models.Aspect, userID string) (err error) PublishAspectDelete(id string, userID string) error PublishFunction(device models.Function, userID string) (err error) PublishFunctionDelete(id string, userID string) error PublishDeviceClass(device models.DeviceClass, userID string) (err error) PublishDeviceClassDelete(id string, userID string) error PublishLocation(device models.Location, userID string) (err error) PublishLocationDelete(id string, userID string) error PublishRights(kind string, id string, element permmodel.ResourceRightsBase) error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.