Documentation ¶
Index ¶
- type Com
- type Controller
- func (this *Controller) DeleteUser(userId string) error
- func (this *Controller) DeviceLocalIdToId(token auth.Token, ownerId string, localId string) (id string, err error, errCode int)
- func (this *Controller) GetCom() Com
- func (this *Controller) ListDevicesByQuery(token auth.Token, query url.Values) (devices []models.Device, err error, code int)
- func (this *Controller) PublishAspectCreate(token auth.Token, aspect models.Aspect, options model.AspectUpdateOptions) (models.Aspect, error, int)
- func (this *Controller) PublishAspectDelete(token auth.Token, id string, options model.AspectDeleteOptions) (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, options model.CharacteristicDeleteOptions) (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, options model.ConceptUpdateOptions) (models.Concept, error, int)
- func (this *Controller) PublishConceptDelete(token auth.Token, id string, options model.ConceptDeleteOptions) (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, options model.DeviceClassDeleteOptions) (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, options model.DeviceCreateOptions) (models.Device, error, int)
- func (this *Controller) PublishDeviceDelete(token auth.Token, id string, options model.DeviceDeleteOptions) (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, options model.DeviceGroupDeleteOptions) (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, options model.DeviceTypeUpdateOptions) (models.DeviceType, error, int)
- func (this *Controller) PublishDeviceTypeDelete(token auth.Token, id string, options model.DeviceTypeDeleteOptions) (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, options model.FunctionDeleteOptions) (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.Hub, options model.HubUpdateOptions) (models.Hub, error, int)
- func (this *Controller) PublishHubDelete(token auth.Token, id string, options model.HubDeleteOptions) (error, int)
- func (this *Controller) PublishHubUpdate(token auth.Token, id string, userId string, hubEdit models.Hub, ...) (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, options model.LocationDeleteOptions) (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, options model.ProtocolDeleteOptions) (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) ReadDeviceByLocalId(token auth.Token, ownerId string, localId string) (device models.Device, err error, errCode 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, deleteUserFromResource []permv2.Resource, err error) GetResourceRights(token auth.Token, kind string, id string) (result model.Resource, err error, code int) SetPermission(token string, topicId string, id string, permissions model.ResourcePermissions) (result model.ResourcePermissions, err error, code int) GetTechnicalDeviceGroup(token auth.Token, id string) (dt models.DeviceGroup, err error, code int) ValidateDeviceGroup(token auth.Token, dt models.DeviceGroup) (err error, code int) ValidateDeviceGroupDelete(token auth.Token, id string) (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) ListDevicesByQuery(token auth.Token, query url.Values) (devices []models.Device, err error, code int) GetDevice(token auth.Token, id string) (models.Device, error, int) //uses internal admin jwt GetDeviceByLocalId(token auth.Token, ownerId string, localid 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) ListDeviceTypes(token string, options client.DeviceTypeListOptions) (result []models.DeviceType, err error, code int) ListDevices(token string, options client.DeviceListOptions) (result []models.Device, 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) GetCom ¶ added in v0.0.32
func (this *Controller) GetCom() Com
func (*Controller) ListDevicesByQuery ¶ added in v0.0.32
func (*Controller) PublishAspectCreate ¶
func (*Controller) PublishAspectDelete ¶
func (this *Controller) PublishAspectDelete(token auth.Token, id string, options model.AspectDeleteOptions) (error, int)
func (*Controller) PublishAspectUpdate ¶
func (*Controller) PublishCharacteristicCreate ¶
func (this *Controller) PublishCharacteristicCreate(token auth.Token, characteristic models.Characteristic, options model.CharacteristicUpdateOptions) (models.Characteristic, error, int)
func (*Controller) PublishCharacteristicDelete ¶
func (this *Controller) PublishCharacteristicDelete(token auth.Token, id string, options model.CharacteristicDeleteOptions) (error, int)
func (*Controller) PublishCharacteristicUpdate ¶
func (this *Controller) PublishCharacteristicUpdate(token auth.Token, characteristicId string, characteristic models.Characteristic, options model.CharacteristicUpdateOptions) (models.Characteristic, error, int)
func (*Controller) PublishConceptCreate ¶
func (*Controller) PublishConceptDelete ¶
func (this *Controller) PublishConceptDelete(token auth.Token, id string, options model.ConceptDeleteOptions) (error, int)
func (*Controller) PublishConceptUpdate ¶
func (*Controller) PublishDeviceClassCreate ¶
func (this *Controller) PublishDeviceClassCreate(token auth.Token, deviceClass models.DeviceClass, options model.DeviceClassUpdateOptions) (models.DeviceClass, error, int)
func (*Controller) PublishDeviceClassDelete ¶
func (this *Controller) PublishDeviceClassDelete(token auth.Token, id string, options model.DeviceClassDeleteOptions) (error, int)
func (*Controller) PublishDeviceClassUpdate ¶
func (this *Controller) PublishDeviceClassUpdate(token auth.Token, id string, deviceClass models.DeviceClass, options model.DeviceClassUpdateOptions) (models.DeviceClass, error, int)
func (*Controller) PublishDeviceCreate ¶
func (*Controller) PublishDeviceDelete ¶
func (this *Controller) PublishDeviceDelete(token auth.Token, id string, options model.DeviceDeleteOptions) (error, int)
func (*Controller) PublishDeviceGroupCreate ¶
func (this *Controller) PublishDeviceGroupCreate(token auth.Token, dg models.DeviceGroup, options model.DeviceGroupUpdateOptions) (result models.DeviceGroup, err error, code int)
func (*Controller) PublishDeviceGroupDelete ¶
func (this *Controller) PublishDeviceGroupDelete(token auth.Token, id string, options model.DeviceGroupDeleteOptions) (error, int)
func (*Controller) PublishDeviceGroupUpdate ¶
func (this *Controller) PublishDeviceGroupUpdate(token auth.Token, id string, dg models.DeviceGroup, options model.DeviceGroupUpdateOptions) (result models.DeviceGroup, err error, code int)
func (*Controller) PublishDeviceTypeCreate ¶
func (this *Controller) PublishDeviceTypeCreate(token auth.Token, dt models.DeviceType, options model.DeviceTypeUpdateOptions) (models.DeviceType, error, int)
func (*Controller) PublishDeviceTypeDelete ¶
func (this *Controller) PublishDeviceTypeDelete(token auth.Token, id string, options model.DeviceTypeDeleteOptions) (error, int)
func (*Controller) PublishDeviceTypeUpdate ¶
func (this *Controller) PublishDeviceTypeUpdate(token auth.Token, id string, dt models.DeviceType, options model.DeviceTypeUpdateOptions) (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 (this *Controller) PublishFunctionDelete(token auth.Token, id string, options model.FunctionDeleteOptions) (error, int)
func (*Controller) PublishFunctionUpdate ¶
func (*Controller) PublishHubCreate ¶
func (*Controller) PublishHubDelete ¶
func (this *Controller) PublishHubDelete(token auth.Token, id string, options model.HubDeleteOptions) (error, int)
func (*Controller) PublishHubUpdate ¶
func (*Controller) PublishLocationCreate ¶
func (*Controller) PublishLocationDelete ¶
func (this *Controller) PublishLocationDelete(token auth.Token, id string, options model.LocationDeleteOptions) (error, int)
func (*Controller) PublishLocationUpdate ¶
func (*Controller) PublishProtocolCreate ¶
func (*Controller) PublishProtocolDelete ¶
func (this *Controller) PublishProtocolDelete(token auth.Token, id string, options model.ProtocolDeleteOptions) (error, int)
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) ReadDeviceByLocalId ¶ added in v0.0.10
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 }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.