Documentation
¶
Index ¶
- Constants
- Variables
- func DeviceIdToGeneratedDeviceGroupId(deviceId string) string
- func GetPermissionFlagFromQuery(query url.Values) (models.PermissionFlag, error)
- func SetFunctionRdfType(function *models.Function)
- type AspectListOptions
- type AuthAction
- type CharacteristicListOptions
- type ConceptListOptions
- type Configurable
- type DeviceClassListOptions
- type DeviceGroupListOptions
- type DeviceListOptions
- type DeviceTypeCriteria
- type DeviceTypeListOptions
- type DeviceTypeReference
- type DeviceTypeSelectable
- type DeviceTypeUpdateOptions
- type DeviceUpdateOptions
- type DeviceWithConnectionState
- type ExtendedDeviceListOptions
- type FilterCriteria
- type FunctionList
- type FunctionListOptions
- type HubListOptions
- type HubWithConnectionState
- type ImportExport
- type ImportExportOptions
- type ImportFromOptions
- type LocationListOptions
- type RefInDeviceTypeResponseElement
- type ResourceRights
- type Right
- type ServicePathOption
- type ServiceReference
- type TotalCount
- type UsedInDeviceTypeQuery
- type UsedInDeviceTypeQueryId
- type UsedInDeviceTypeResponse
- type ValidationOptions
- type VariableReference
Constants ¶
View Source
const ( READ = models.Read WRITE = models.Write EXECUTE = models.Execute ADMINISTRATE = models.Administrate )
View Source
const CONTROLLING_FUNCTION_PREFIX = "urn:infai:ses:controlling-function:"
View Source
const MEASURING_FUNCTION_PREFIX = "urn:infai:ses:measuring-function:"
View Source
const PREFIX_RDF = "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>"
View Source
const PREFIX_SES = "PREFIX ses: <https://senergy.infai.org/ontology/> "
PREFIXES
View Source
const RDFS_COMMENT = "http://www.w3.org/2000/01/rdf-schema#comment"
View Source
const RDFS_LABEL = "http://www.w3.org/2000/01/rdf-schema#label"
View Source
const RDF_TYPE = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
View Source
const SES_ONTOLOGY_ASPECT = "https://senergy.infai.org/ontology/Aspect"
View Source
const SES_ONTOLOGY_CHARACTERISTIC = "https://senergy.infai.org/ontology/Characteristic"
View Source
const SES_ONTOLOGY_CONCEPT = "https://senergy.infai.org/ontology/Concept"
View Source
const SES_ONTOLOGY_CONTROLLING_FUNCTION = "https://senergy.infai.org/ontology/ControllingFunction"
View Source
const SES_ONTOLOGY_COUNT = "https://senergy.infai.org/ontology/Count"
View Source
const SES_ONTOLOGY_DEVICE_CLASS = "https://senergy.infai.org/ontology/DeviceClass"
View Source
const SES_ONTOLOGY_DEVICE_TYPE = "https://senergy.infai.org/ontology/DeviceType"
View Source
const SES_ONTOLOGY_EXPOSES_FUNCTION = "https://senergy.infai.org/ontology/exposesFunction"
View Source
const SES_ONTOLOGY_HAS_BASE_CHARACTERISTIC = "https://senergy.infai.org/ontology/hasBaseCharacteristic"
View Source
const SES_ONTOLOGY_HAS_CHARACTERISTIC = "https://senergy.infai.org/ontology/hasCharacteristic"
View Source
const SES_ONTOLOGY_HAS_CONCEPT = "https://senergy.infai.org/ontology/hasConcept"
View Source
const SES_ONTOLOGY_HAS_DEVICE_CLASS = "https://senergy.infai.org/ontology/hasDeviceClass"
View Source
const SES_ONTOLOGY_HAS_IMAGE = "https://senergy.infai.org/ontology/hasImage"
View Source
const SES_ONTOLOGY_HAS_INTERACTION = "https://senergy.infai.org/ontology/interaction"
View Source
const SES_ONTOLOGY_HAS_MAX_VALUE = "https://senergy.infai.org/ontology/hasMaxValue"
View Source
const SES_ONTOLOGY_HAS_MIN_VALUE = "https://senergy.infai.org/ontology/hasMinValue"
View Source
const SES_ONTOLOGY_HAS_PROTOCOL = "https://senergy.infai.org/ontology/hasProtocol"
View Source
const SES_ONTOLOGY_HAS_SERVICE = "https://senergy.infai.org/ontology/hasService"
View Source
const SES_ONTOLOGY_HAS_SUB_CHARACTERISTIC = "https://senergy.infai.org/ontology/hasSubCharacteristic"
View Source
const SES_ONTOLOGY_HAS_VALUE = "https://senergy.infai.org/ontology/hasValue"
View Source
const SES_ONTOLOGY_HAS_VALUE_TYPE = "https://senergy.infai.org/ontology/hasValueType"
View Source
const SES_ONTOLOGY_LOCATION = "https://senergy.infai.org/ontology/Location"
View Source
const SES_ONTOLOGY_MEASURING_FUNCTION = "https://senergy.infai.org/ontology/MeasuringFunction"
View Source
const SES_ONTOLOGY_REFERS_TO = "https://senergy.infai.org/ontology/refersTo"
View Source
const SES_ONTOLOGY_SERVICE = "https://senergy.infai.org/ontology/Service"
View Source
const SES_ONTOLOGY_TOTAL_COUNT = "https://senergy.infai.org/ontology/totalCount"
View Source
const SenergyConnectorLocalIdConstraint = "senergy_connector_local_id"
View Source
const URN_DEVICE_TYPE_PREFIX = URN_PREFIX + "device-type:"
View Source
const URN_PREFIX = "urn:infai:ses:"
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
View Source
var PermissionCheckFailed = errors.New("permission check failed")
View Source
var True = true
View Source
var TruePtr = &True
Functions ¶
func DeviceIdToGeneratedDeviceGroupId ¶ added in v0.2.9
func GetPermissionFlagFromQuery ¶ added in v0.1.0
func GetPermissionFlagFromQuery(query url.Values) (models.PermissionFlag, error)
func SetFunctionRdfType ¶
Types ¶
type AspectListOptions ¶ added in v0.1.40
type AspectListOptions struct {
Ids []string //filter; ignores limit/offset if Ids != nil; ignored if Ids == nil; Ids == []string{} will return an empty list;
Search string
Limit int64 //default 100, will be ignored if 'ids' is set (Ids != nil)
Offset int64 //default 0, will be ignored if 'ids' is set (Ids != nil)
SortBy string //default name.asc
}
type AuthAction ¶
type AuthAction = models.PermissionFlag
type CharacteristicListOptions ¶ added in v0.1.48
type CharacteristicListOptions struct {
Ids []string //filter; ignores limit/offset if Ids != nil; ignored if Ids == nil; Ids == []string{} will return an empty list;
Search string
Limit int64 //default 100, will be ignored if 'ids' is set (Ids != nil)
Offset int64 //default 0, will be ignored if 'ids' is set (Ids != nil)
SortBy string //default name.asc
}
type ConceptListOptions ¶ added in v0.1.41
type ConceptListOptions struct {
Ids []string //filter; ignores limit/offset if Ids != nil; ignored if Ids == nil; Ids == []string{} will return an empty list;
Search string
Limit int64 //default 100, will be ignored if 'ids' is set (Ids != nil)
Offset int64 //default 0, will be ignored if 'ids' is set (Ids != nil)
SortBy string //default name.asc
}
type Configurable ¶
type DeviceClassListOptions ¶ added in v0.1.43
type DeviceClassListOptions struct {
Ids []string //filter; ignores limit/offset if Ids != nil; ignored if Ids == nil; Ids == []string{} will return an empty list;
UsedWithControllingFunction bool //filter; ignore if false; if true, only return device-classes that are used with a controlling function
Search string
Limit int64 //default 100, will be ignored if 'ids' is set (Ids != nil)
Offset int64 //default 0, will be ignored if 'ids' is set (Ids != nil)
SortBy string //default name.asc
}
type DeviceGroupListOptions ¶ added in v0.1.25
type DeviceGroupListOptions struct {
Ids []string //filter; ignores limit/offset if Ids != nil; ignored if Ids == nil; Ids == []string{} will return an empty list;
DeviceIds []string //filter; find device-groups with any of the listed devices
Search string
Limit int64 //default 100, will be ignored if 'ids' is set (Ids != nil)
Offset int64 //default 0, will be ignored if 'ids' is set (Ids != nil)
SortBy string //default name.asc
AttributeKeys []string //filter; ignored if nil; AttributeKeys and AttributeValues are independently evaluated, needs local filtering if a search like "attr1"="value1" is needed
AttributeValues []string //filter; ignored if nil; AttributeKeys and AttributeValues are independently evaluated, needs local filtering if a search like "attr1"="value1" is needed
Criteria []FilterCriteria //filter; ignored if nil
Permission models.PermissionFlag //defaults to read
IgnoreGenerated bool //remove generated groups from result
FilterGenericDuplicateCriteria bool
}
type DeviceListOptions ¶ added in v0.0.20
type DeviceListOptions struct {
Ids []string //filter; ignores limit/offset if Ids != nil; ignored if Ids == nil; Ids == []string{} will return an empty list;
LocalIds []string //filter; in combination with owner; fills ids filter; comma-seperated list; ignored if LocalIds == nil; LocalIds == []string{} will return an empty list;
Owner string //used in combination with local_ids to fill ids filter; defaults to requesting user
DeviceTypeIds []string //filter; ignored if DeviceTypeIds == nil; DeviceTypeIds == []string{} will return an empty list;
ConnectionState *models.ConnectionState //filter
Search string
Limit int64 //default 100, will be ignored if 'ids' is set (Ids != nil)
Offset int64 //default 0, will be ignored if 'ids' is set (Ids != nil)
SortBy string //default name.asc
Permission models.PermissionFlag //defaults to read
AttributeKeys []string //filter; ignored if nil; AttributeKeys and AttributeValues are independently evaluated, needs local filtering if a search like "attr1"="value1" is needed
AttributeValues []string //filter; ignored if nil; AttributeKeys and AttributeValues are independently evaluated, needs local filtering if a search like "attr1"="value1" is needed
DeviceAttributeBlacklist []models.Attribute //filter; attribute value and origin will only be checked if set, otherwise all values or origins will be blacklisted
}
type DeviceTypeCriteria ¶
type DeviceTypeCriteria struct {
IsIdModified bool `json:"is_id_modified"`
PureDeviceTypeId string `json:"pure_device_type_id"`
DeviceTypeId string `json:"device_type_id"`
ServiceId string `json:"service_id"`
ContentVariableId string `json:"content_variable_id"`
ContentVariablePath string `json:"content_variable_path"`
FunctionId string `json:"function_id"`
Interaction string `json:"interaction"`
IsControllingFunction bool `json:"controlling_function"`
DeviceClassId string `json:"device_class_id"`
AspectId string `json:"aspect_id"`
CharacteristicId string `json:"characteristic_id"`
IsVoid bool `json:"is_void"`
Value interface{} `json:"value"`
Type models.Type `json:"type"`
IsLeaf bool `json:"is_leaf"`
IsInput bool `json:"is_input"`
}
type DeviceTypeListOptions ¶ added in v0.1.12
type DeviceTypeListOptions struct {
Ids []string
Search string
Limit int64 //default 100, will be ignored if 'ids' is set (Ids != nil)
Offset int64 //default 0, will be ignored if 'ids' is set (Ids != nil)
SortBy string //default name.asc
AttributeKeys []string //filter; ignored if nil; AttributeKeys and AttributeValues are independently evaluated, needs local filtering if a search like "attr1"="value1" is needed
AttributeValues []string //filter; ignored if nil; AttributeKeys and AttributeValues are independently evaluated, needs local filtering if a search like "attr1"="value1" is needed
Criteria []FilterCriteria //filter; ignored if nil
ProtocolIds []string
IncludeModified bool
IgnoreUnmodified bool
}
type DeviceTypeReference ¶ added in v0.0.6
type DeviceTypeReference struct {
Id string `json:"id"`
Name string `json:"name"`
UsedIn []ServiceReference `json:"used_in,omitempty"`
}
type DeviceTypeSelectable ¶
type DeviceTypeSelectable struct {
DeviceTypeId string `json:"device_type_id,omitempty"`
Services []models.Service `json:"services,omitempty"`
ServicePathOptions map[string][]ServicePathOption `json:"service_path_options,omitempty"`
}
type DeviceTypeUpdateOptions ¶ added in v0.1.53
type DeviceTypeUpdateOptions struct {
DistinctAttributes []string
}
type DeviceUpdateOptions ¶ added in v0.1.53
type DeviceUpdateOptions struct {
UpdateOnlySameOriginAttributes []string
}
type DeviceWithConnectionState ¶ added in v0.1.0
type DeviceWithConnectionState struct {
models.Device `bson:",inline"`
ConnectionState models.ConnectionState `json:"connection_state" bson:"connection_state"`
DisplayName string `json:"display_name" bson:"display_name"`
}
type ExtendedDeviceListOptions ¶ added in v0.1.23
type ExtendedDeviceListOptions struct {
Ids []string //filter; ignores limit/offset if Ids != nil; ignored if Ids == nil; Ids == []string{} will return an empty list;
LocalIds []string //filter; in combination with owner; fills ids filter; comma-seperated list; ignored if LocalIds == nil; LocalIds == []string{} will return an empty list;
Owner string //used in combination with local_ids to fill ids filter; defaults to requesting user
DeviceTypeIds []string //filter; ignored if DeviceTypeIds == nil; DeviceTypeIds == []string{} will return an empty list;
ConnectionState *models.ConnectionState //filter
Search string
Limit int64 //default 100, will be ignored if 'ids' is set (Ids != nil)
Offset int64 //default 0, will be ignored if 'ids' is set (Ids != nil)
SortBy string //default name.asc
Permission models.PermissionFlag //defaults to read
AttributeKeys []string //filter; ignored if nil; AttributeKeys and AttributeValues are independently evaluated, needs local filtering if a search like "attr1"="value1" is needed
AttributeValues []string //filter; ignored if nil; AttributeKeys and AttributeValues are independently evaluated, needs local filtering if a search like "attr1"="value1" is needed
FullDt bool //if true, result contains full device-type
DeviceAttributeBlacklist []models.Attribute //filter; attribute value and origin will only be checked if set, otherwise all values or origins will be blacklisted
}
func (ExtendedDeviceListOptions) ToDeviceListOptions ¶ added in v0.1.23
func (this ExtendedDeviceListOptions) ToDeviceListOptions() DeviceListOptions
type FilterCriteria ¶
type FilterCriteria struct {
Interaction models.Interaction `json:"interaction"`
FunctionId string `json:"function_id"`
DeviceClassId string `json:"device_class_id"`
AspectId string `json:"aspect_id"`
}
type FunctionList ¶
type FunctionListOptions ¶ added in v0.1.38
type FunctionListOptions struct {
Ids []string //filter; ignores limit/offset if Ids != nil; ignored if Ids == nil; Ids == []string{} will return an empty list;
RdfType string // model.SES_ONTOLOGY_CONTROLLING_FUNCTION || model.SES_ONTOLOGY_MEASURING_FUNCTION
Search string
Limit int64 //default 100, will be ignored if 'ids' is set (Ids != nil)
Offset int64 //default 0, will be ignored if 'ids' is set (Ids != nil)
SortBy string //default name.asc
}
type HubListOptions ¶ added in v0.1.0
type HubListOptions struct {
Ids []string ///filter; ignores limit/offset if Ids != nil; ignored if Ids == nil; Ids == []string{} will return an empty list;
ConnectionState *models.ConnectionState //filter
Search string
Limit int64 //default 100, will be ignored if 'ids' is set (Ids != nil)
Offset int64 //default 0, will be ignored if 'ids' is set (Ids != nil)
SortBy string //default name.asc
Permission models.PermissionFlag //defaults to read
LocalDeviceId string //filter; list hubs if they contain the device-id
OwnerId string //only used in combination with LocalDeviceId; defaults to requesting user
}
type HubWithConnectionState ¶ added in v0.1.0
type HubWithConnectionState struct {
models.Hub `bson:",inline"`
ConnectionState models.ConnectionState `json:"connection_state"`
}
type ImportExport ¶ added in v0.1.53
type ImportExport struct {
Protocols []models.Protocol `json:"protocols,omitempty"`
Functions []models.Function `json:"functions,omitempty"`
Aspects []models.Aspect `json:"aspects,omitempty"`
Concepts []models.Concept `json:"concepts,omitempty"`
Characteristics []models.Characteristic `json:"characteristics,omitempty"`
DeviceClasses []models.DeviceClass `json:"device_classes,omitempty"`
DeviceTypes []models.DeviceType `json:"device_types,omitempty"`
//include_owned_information == true
Devices []models.Device `json:"devices,omitempty"`
DeviceGroups []models.DeviceGroup `json:"device_groups,omitempty"`
Hubs []models.Hub `json:"hubs,omitempty"`
Locations []models.Location `json:"locations,omitempty"`
Permissions []permissions.Resource `json:"permissions,omitempty"`
}
func (*ImportExport) Sort ¶ added in v0.2.9
func (this *ImportExport) Sort()
type ImportExportOptions ¶ added in v0.1.53
type ImportExportOptions struct {
IncludeOwnedInformation bool `json:"include_owned_information"`
FilterResourceTypes []string `json:"filter_resource_types,omitempty"` //ref resource types-like 'device-types' similar to http-endpoints; null->all; []->none
FilterIds []string `json:"filter_ids,omitempty"` //ref ids of any resource-type; null->all; []->none
}
type ImportFromOptions ¶ added in v0.2.11
type ImportFromOptions struct {
FilterResourceTypes []string `json:"filter_resource_types,omitempty"` //ref resource types-like 'device-types' similar to http-endpoints; null->all; []->none
FilterIds []string `json:"filter_ids,omitempty"` //ref ids of any resource-type; null->all; []->none
RemoteDeviceRepository string `json:"remote_device_repository"` //address of a remote device-repository, where the data is imported from
RemoteAuthToken string `json:"remote_auth_token"` //auth token used for requests to the remote device-repository
}
type LocationListOptions ¶ added in v0.1.30
type LocationListOptions struct {
Ids []string //filter; ignores limit/offset if Ids != nil; ignored if Ids == nil; Ids == []string{} will return an empty list;
Search string
Limit int64 //default 100, will be ignored if 'ids' is set (Ids != nil)
Offset int64 //default 0, will be ignored if 'ids' is set (Ids != nil)
SortBy string //default name.asc
Permission models.PermissionFlag //defaults to read
}
type RefInDeviceTypeResponseElement ¶ added in v0.0.6
type RefInDeviceTypeResponseElement struct {
Count int `json:"count"`
UsedIn []DeviceTypeReference `json:"used_in"`
}
type ResourceRights ¶ added in v0.0.12
type ResourceRights struct {
UserRights map[string]Right `json:"user_rights"`
GroupRights map[string]Right `json:"group_rights"`
KeycloakGroupsRights map[string]Right `json:"keycloak_groups_rights"`
}
func ResourceRightsFromPermission ¶ added in v0.1.26
func ResourceRightsFromPermission(perm model2.ResourcePermissions) ResourceRights
func (ResourceRights) ToPermV2Permissions ¶ added in v0.1.15
func (this ResourceRights) ToPermV2Permissions() client.ResourcePermissions
type ServicePathOption ¶
type ServicePathOption struct {
ServiceId string `json:"service_id"`
Path string `json:"path"`
CharacteristicId string `json:"characteristic_id"`
AspectNode models.AspectNode `json:"aspect_node"`
FunctionId string `json:"function_id"`
IsVoid bool `json:"is_void"`
Value interface{} `json:"value,omitempty"`
IsControllingFunction bool `json:"is_controlling_function"`
Configurables []Configurable `json:"configurables,omitempty"`
Type models.Type `json:"type,omitempty"`
Interaction models.Interaction `json:"interaction"`
}
type ServiceReference ¶ added in v0.0.6
type ServiceReference struct {
Id string `json:"id"`
Name string `json:"name"`
UsedIn []VariableReference `json:"used_in,omitempty"`
}
type TotalCount ¶
type TotalCount struct {
TotalCount int `json:"total_count"`
}
type UsedInDeviceTypeQuery ¶ added in v0.0.6
type UsedInDeviceTypeQuery struct {
Resource string `json:"resource"` // "aspects"|"functions"|"device-classes"|"characteristics"
With string `json:"with,omitempty"` // ""|"device-type"|"service"|"variable": selects how deep the result "used_in" is set; defaults to "device-type"
CountBy string `json:"count_by,omitempty"` // ""|"device-type"|"service"|"variable": selects what is counted; defaults to "device-type"
Ids []UsedInDeviceTypeQueryId `json:"ids"`
}
type UsedInDeviceTypeQueryId ¶ added in v0.0.6
type UsedInDeviceTypeQueryId = string
type UsedInDeviceTypeResponse ¶ added in v0.0.6
type UsedInDeviceTypeResponse = map[UsedInDeviceTypeQueryId]RefInDeviceTypeResponseElement
type ValidationOptions ¶ added in v0.0.5
type ValidationOptions struct {
AllowNoneLeafAspectNodesInDeviceTypes *bool
}
func LoadDeviceTypeValidationOptions ¶ added in v0.0.5
func LoadDeviceTypeValidationOptions(query url.Values) (result ValidationOptions, err error)
func (ValidationOptions) AsUrlValues ¶ added in v0.0.5
func (this ValidationOptions) AsUrlValues() url.Values
func (*ValidationOptions) CheckAllowNoneLeafAspectNodesInDeviceTypes ¶ added in v0.0.5
func (this *ValidationOptions) CheckAllowNoneLeafAspectNodesInDeviceTypes(defaults configuration.Config) bool
type VariableReference ¶ added in v0.0.6
Click to show internal directories.
Click to hide internal directories.