Documentation ¶
Index ¶
- Variables
- func NewTestDB(config config.Config) database.Database
- type DB
- func (db *DB) AddAspectNode(_ context.Context, node models.AspectNode) error
- func (db *DB) AspectIsUsed(ctx context.Context, id string) (result bool, where []string, err error)
- func (db *DB) CharacteristicIsUsed(ctx context.Context, id string) (result bool, where []string, err error)
- func (db *DB) CharacteristicIsUsedWithConceptInDeviceType(ctx context.Context, characteristicId string, conceptId string) (result bool, where []string, err error)
- func (this *DB) CheckBool(token string, kind string, id string, action model.AuthAction) (allowed bool, err error)
- func (this *DB) CheckMultiple(token string, kind string, ids []string, action model.AuthAction) (result map[string]bool, err error)
- func (db *DB) ConceptIsUsed(ctx context.Context, id string) (result bool, where []string, err error)
- func (db *DB) DeviceClassIsUsed(ctx context.Context, id string) (result bool, where []string, err error)
- func (db *DB) DeviceLocalIdsToIds(ctx context.Context, owner string, localIds []string) (ids []string, err error)
- func (db *DB) Disconnect()
- func (db *DB) FunctionIsUsed(ctx context.Context, id string) (result bool, where []string, err error)
- func (this *DB) GetAdminUsers(token string, topic string, resourceId string) (admins []string, err error)
- func (db *DB) GetAspect(_ context.Context, id string) (result models.Aspect, exists bool, err error)
- func (db *DB) GetAspectNode(_ context.Context, id string) (result models.AspectNode, exists bool, err error)
- func (db *DB) GetCharacteristic(_ context.Context, id string) (result models.Characteristic, exists bool, err error)
- func (db *DB) GetConceptWithCharacteristics(_ context.Context, id string) (result models.ConceptWithCharacteristics, exists bool, err error)
- func (db *DB) GetConceptWithoutCharacteristics(_ context.Context, id string) (result models.Concept, exists bool, err error)
- func (db *DB) GetConfigurableCandidates(_ context.Context, serviceId string) (result []model.DeviceTypeCriteria, err error)
- func (db *DB) GetDevice(_ context.Context, id string) (device model.DeviceWithConnectionState, exists bool, err error)
- func (db *DB) GetDeviceByLocalId(_ context.Context, ownerId string, localId string) (device model.DeviceWithConnectionState, exists bool, err error)
- func (db *DB) GetDeviceClass(_ context.Context, id string) (result models.DeviceClass, exists bool, err error)
- func (db *DB) GetDeviceGroup(_ context.Context, id string) (deviceGroup models.DeviceGroup, exists bool, err error)
- func (db *DB) GetDeviceType(_ context.Context, id string) (deviceType models.DeviceType, exists bool, err error)
- func (db *DB) GetDeviceTypeCriteriaByAspectIds(ctx context.Context, ids []string, includeModified bool) (result []model.DeviceTypeCriteria, err error)
- func (db *DB) GetDeviceTypeCriteriaByCharacteristicIds(ctx context.Context, ids []string, includeModified bool) (result []model.DeviceTypeCriteria, err error)
- func (db *DB) GetDeviceTypeCriteriaByDeviceClassIds(ctx context.Context, ids []string, includeModified bool) (result []model.DeviceTypeCriteria, err error)
- func (db *DB) GetDeviceTypeCriteriaByFunctionIds(ctx context.Context, ids []string, includeModified bool) (result []model.DeviceTypeCriteria, err error)
- func (db *DB) GetDeviceTypeCriteriaForDeviceTypeIdsAndFilterCriteria(ctx context.Context, deviceTypeIds []interface{}, ...) (result []model.DeviceTypeCriteria, err error)
- func (db *DB) GetDeviceTypeIdsByFilterCriteria(ctx context.Context, criteria []model.FilterCriteria, ...) (result []interface{}, err error)
- func (db *DB) GetDeviceTypeIdsByFilterCriteriaV2(ctx context.Context, criteria []model.FilterCriteria, includeModified bool) (result []interface{}, err error)
- func (db *DB) GetDeviceTypesByServiceId(_ context.Context, serviceId string) (result []models.DeviceType, err error)
- func (db *DB) GetFunction(_ context.Context, id string) (result models.Function, exists bool, err error)
- func (db *DB) GetHub(_ context.Context, id string) (hub model.HubWithConnectionState, exists bool, err error)
- func (db *DB) GetHubsByDeviceId(_ context.Context, id string) (hubs []model.HubWithConnectionState, err error)
- func (db *DB) GetLocation(_ context.Context, id string) (result models.Location, exists bool, err error)
- func (this *DB) GetPermissionsInfo(token string, kind string, id string) (requestingUser string, permissions models.Permissions, err error)
- func (db *DB) GetProtocol(_ context.Context, id string) (result models.Protocol, exists bool, err error)
- func (this *DB) ListAccessibleResourceIds(token string, topic string, limit int64, offset int64, action model.AuthAction) (result []string, err error)
- func (db *DB) ListAllAspectNodes(_ context.Context) ([]models.AspectNode, error)
- func (db *DB) ListAllAspects(_ context.Context) ([]models.Aspect, error)
- func (db *DB) ListAllCharacteristics(_ context.Context) ([]models.Characteristic, error)
- func (db *DB) ListAllControllingFunctionsByDeviceClass(_ context.Context, class string) ([]models.Function, error)
- func (db *DB) ListAllDeviceClasses(_ context.Context) ([]models.DeviceClass, error)
- func (db *DB) ListAllDeviceClassesUsedWithControllingFunctions(_ context.Context) ([]models.DeviceClass, error)
- func (db *DB) ListAllFunctionsByDeviceClass(_ context.Context, class string) ([]models.Function, error)
- func (db *DB) ListAllFunctionsByType(_ context.Context, rdfType string) (result []models.Function, err error)
- func (db *DB) ListAllMeasuringFunctionsByAspect(_ context.Context, aspect string, ancestors bool, descendants bool) ([]models.Function, error)
- func (db *DB) ListAspectNodes(ctx context.Context, options model.AspectListOptions) (result []models.AspectNode, total int64, err error)
- func (db *DB) ListAspectNodesByIdList(_ context.Context, ids []string) (result []models.AspectNode, err error)
- func (db *DB) ListAspectNodesWithMeasuringFunction(_ context.Context, ancestors bool, descendants bool) ([]models.AspectNode, error)
- func (db *DB) ListAspects(ctx context.Context, options model.AspectListOptions) (result []models.Aspect, total int64, err error)
- func (db *DB) ListAspectsWithMeasuringFunction(_ context.Context, ancestors bool, descendants bool) ([]models.Aspect, error)
- func (db *DB) ListConcepts(ctx context.Context, options model.ConceptListOptions) (result []models.Concept, total int64, err error)
- func (db *DB) ListConceptsWithCharacteristics(ctx context.Context, options model.ConceptListOptions) ([]models.ConceptWithCharacteristics, int64, error)
- func (db *DB) ListDeviceClasses(ctx context.Context, options model.DeviceClassListOptions) (result []models.DeviceClass, total int64, err error)
- func (db *DB) ListDeviceGroups(_ context.Context, options model.DeviceGroupListOptions) (result []models.DeviceGroup, total int64, err error)
- func (db *DB) ListDeviceTypes(ctx context.Context, limit int64, offset int64, sort string, ...) (result []models.DeviceType, err error)
- func (db *DB) ListDeviceTypesV2(ctx context.Context, limit int64, offset int64, sort string, ...) (result []models.DeviceType, err error)
- func (db *DB) ListDeviceTypesV3(ctx context.Context, listOptions model.DeviceTypeListOptions) (result []models.DeviceType, total int64, err error)
- func (db *DB) ListDevices(ctx context.Context, options model.DeviceListOptions, withTotal bool) (devices []model.DeviceWithConnectionState, total int64, err error)
- func (db *DB) ListFunctions(ctx context.Context, options model.FunctionListOptions) (result []models.Function, total int64, err error)
- func (db *DB) ListHubs(ctx context.Context, options model.HubListOptions, withTotal bool) (hubs []model.HubWithConnectionState, total int64, err error)
- func (db *DB) ListLocations(ctx context.Context, options model.LocationListOptions) (locations []models.Location, total int64, err error)
- func (db *DB) ListProtocols(_ context.Context, limit int64, offset int64, sort string) ([]models.Protocol, error)
- func (db *DB) RemoveAspect(_ context.Context, id string) error
- func (db *DB) RemoveAspectNodesByRootId(_ context.Context, id string) error
- func (db *DB) RemoveCharacteristic(_ context.Context, id string) error
- func (db *DB) RemoveConcept(_ context.Context, id string) error
- func (db *DB) RemoveDevice(_ context.Context, id string) error
- func (db *DB) RemoveDeviceClass(_ context.Context, id string) error
- func (db *DB) RemoveDeviceGroup(_ context.Context, id string) error
- func (db *DB) RemoveDeviceType(_ context.Context, id string) error
- func (db *DB) RemoveFunction(_ context.Context, id string) error
- func (db *DB) RemoveHub(_ context.Context, id string) error
- func (db *DB) RemoveLocation(_ context.Context, id string) error
- func (db *DB) RemoveProtocol(_ context.Context, id string) error
- func (this *DB) RemoveRights(topic string, id string) error
- func (this *DB) RightsElementExists(topic string, resourceId string) (exists bool, err error)
- func (db *DB) RunStartupMigrations(methods mongo.GeneratedDeviceGroupMigrationMethods) error
- func (db *DB) SetAspect(_ context.Context, aspect models.Aspect) error
- func (db *DB) SetAspectNode(_ context.Context, node models.AspectNode) error
- func (db *DB) SetCharacteristic(_ context.Context, characteristic models.Characteristic) error
- func (db *DB) SetConcept(_ context.Context, concept models.Concept) error
- func (db *DB) SetDevice(_ context.Context, device model.DeviceWithConnectionState) error
- func (db *DB) SetDeviceClass(_ context.Context, class models.DeviceClass) error
- func (db *DB) SetDeviceConnectionState(ctx context.Context, id string, state models.ConnectionState) error
- func (db *DB) SetDeviceGroup(_ context.Context, deviceGroup models.DeviceGroup) error
- func (db *DB) SetDeviceType(_ context.Context, deviceType models.DeviceType) error
- func (db *DB) SetFunction(_ context.Context, function models.Function) error
- func (db *DB) SetHub(_ context.Context, hub model.HubWithConnectionState) error
- func (db *DB) SetHubConnectionState(ctx context.Context, id string, state models.ConnectionState) error
- func (db *DB) SetLocation(_ context.Context, location models.Location) error
- func (db *DB) SetProtocol(_ context.Context, protocol models.Protocol) error
- func (this *DB) SetRights(resourceKind string, resourceId string, rights model.ResourceRights) error
- type GetOptions
- type Resource
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
View Source
var PermissionCheckFailed = errors.New("permission check failed")
View Source
var STRICT = true
Functions ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) AddAspectNode ¶
func (*DB) AspectIsUsed ¶
func (*DB) CharacteristicIsUsed ¶
func (*DB) CharacteristicIsUsedWithConceptInDeviceType ¶
func (*DB) CheckMultiple ¶ added in v0.0.12
func (*DB) ConceptIsUsed ¶
func (*DB) DeviceClassIsUsed ¶
func (*DB) DeviceLocalIdsToIds ¶ added in v0.1.24
func (*DB) Disconnect ¶
func (db *DB) Disconnect()
func (*DB) FunctionIsUsed ¶
func (*DB) GetAdminUsers ¶ added in v0.0.18
func (*DB) GetAspectNode ¶
func (*DB) GetCharacteristic ¶
func (*DB) GetConceptWithCharacteristics ¶
func (*DB) GetConceptWithoutCharacteristics ¶
func (*DB) GetConfigurableCandidates ¶
func (*DB) GetDeviceByLocalId ¶
func (*DB) GetDeviceClass ¶
func (*DB) GetDeviceGroup ¶
func (*DB) GetDeviceType ¶
func (*DB) GetDeviceTypeCriteriaByAspectIds ¶ added in v0.0.6
func (*DB) GetDeviceTypeCriteriaByCharacteristicIds ¶ added in v0.0.6
func (*DB) GetDeviceTypeCriteriaByDeviceClassIds ¶ added in v0.0.6
func (*DB) GetDeviceTypeCriteriaByFunctionIds ¶ added in v0.0.6
func (*DB) GetDeviceTypeCriteriaForDeviceTypeIdsAndFilterCriteria ¶
func (db *DB) GetDeviceTypeCriteriaForDeviceTypeIdsAndFilterCriteria(ctx context.Context, deviceTypeIds []interface{}, criteria model.FilterCriteria, includeModified bool) (result []model.DeviceTypeCriteria, err error)
func (*DB) GetDeviceTypeIdsByFilterCriteria ¶
func (*DB) GetDeviceTypeIdsByFilterCriteriaV2 ¶
func (*DB) GetDeviceTypesByServiceId ¶
func (*DB) GetFunction ¶
func (*DB) GetHubsByDeviceId ¶ added in v0.0.20
func (*DB) GetLocation ¶
func (*DB) GetPermissionsInfo ¶ added in v0.1.0
func (*DB) GetProtocol ¶
func (*DB) ListAccessibleResourceIds ¶ added in v0.0.20
func (*DB) ListAllAspectNodes ¶
func (*DB) ListAllAspects ¶
func (*DB) ListAllCharacteristics ¶
func (*DB) ListAllControllingFunctionsByDeviceClass ¶
func (*DB) ListAllDeviceClasses ¶
func (*DB) ListAllFunctionsByDeviceClass ¶
func (*DB) ListAllFunctionsByType ¶
func (*DB) ListAllMeasuringFunctionsByAspect ¶
func (*DB) ListAspectNodes ¶ added in v0.1.40
func (db *DB) ListAspectNodes(ctx context.Context, options model.AspectListOptions) (result []models.AspectNode, total int64, err error)
func (*DB) ListAspectNodesByIdList ¶
func (*DB) ListAspectNodesWithMeasuringFunction ¶
func (*DB) ListAspects ¶ added in v0.1.40
func (*DB) ListAspectsWithMeasuringFunction ¶
func (*DB) ListConcepts ¶ added in v0.1.41
func (*DB) ListConceptsWithCharacteristics ¶ added in v0.1.41
func (db *DB) ListConceptsWithCharacteristics(ctx context.Context, options model.ConceptListOptions) ([]models.ConceptWithCharacteristics, int64, error)
func (*DB) ListDeviceClasses ¶ added in v0.1.43
func (db *DB) ListDeviceClasses(ctx context.Context, options model.DeviceClassListOptions) (result []models.DeviceClass, total int64, err error)
func (*DB) ListDeviceGroups ¶
func (db *DB) ListDeviceGroups(_ context.Context, options model.DeviceGroupListOptions) (result []models.DeviceGroup, total int64, err error)
func (*DB) ListDeviceTypes ¶
func (*DB) ListDeviceTypesV2 ¶
func (*DB) ListDeviceTypesV3 ¶ added in v0.1.12
func (db *DB) ListDeviceTypesV3(ctx context.Context, listOptions model.DeviceTypeListOptions) (result []models.DeviceType, total int64, err error)
func (*DB) ListDevices ¶ added in v0.1.0
func (db *DB) ListDevices(ctx context.Context, options model.DeviceListOptions, withTotal bool) (devices []model.DeviceWithConnectionState, total int64, err error)
func (*DB) ListFunctions ¶ added in v0.1.38
func (*DB) ListHubs ¶ added in v0.1.0
func (db *DB) ListHubs(ctx context.Context, options model.HubListOptions, withTotal bool) (hubs []model.HubWithConnectionState, total int64, err error)
func (*DB) ListLocations ¶ added in v0.1.30
func (*DB) ListProtocols ¶
func (*DB) RemoveAspectNodesByRootId ¶
func (*DB) RemoveCharacteristic ¶
func (*DB) RemoveRights ¶ added in v0.0.12
func (*DB) RightsElementExists ¶ added in v0.1.15
func (*DB) RunStartupMigrations ¶ added in v0.0.15
func (db *DB) RunStartupMigrations(methods mongo.GeneratedDeviceGroupMigrationMethods) error
func (*DB) SetAspectNode ¶
func (*DB) SetCharacteristic ¶
func (*DB) SetDeviceClass ¶
func (*DB) SetDeviceConnectionState ¶ added in v0.1.0
func (*DB) SetDeviceGroup ¶
func (*DB) SetDeviceType ¶
func (*DB) SetFunction ¶
func (*DB) SetHubConnectionState ¶ added in v0.1.0
func (*DB) SetLocation ¶
func (*DB) SetProtocol ¶
type GetOptions ¶ added in v0.0.20
type GetOptions struct { CheckPermission bool UserId string GroupIds []string Permissions []model.AuthAction }
Click to show internal directories.
Click to hide internal directories.