pkg

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryEqualOperation             = client.QueryEqualOperation
	QueryUnequalOperation           = client.QueryUnequalOperation
	QueryAnyValueInFeatureOperation = client.QueryAnyValueInFeatureOperation
)

Variables

This section is empty.

Functions

func GetJson

func GetJson(token string, url string, out interface{}) (err error)

func QueryPermissionSearchFindAll

func QueryPermissionSearchFindAll[T any](lib *Lib, token string, query QueryMessage, idGetter func(e T) string) (result []T, err error, code int)

Types

type AspectNodeQuery

type AspectNodeQuery struct {
	Ids []string `json:"ids"`
}

type BpmnResource

type BpmnResource struct {
	Id string `json:"id" bson:"id"`
	// contains filtered or unexported fields
}

type CharacteristicsWrapper

type CharacteristicsWrapper struct {
	Raw model.Characteristic `json:"raw"`
}

type ConditionConfig

type ConditionConfig = client.ConditionConfig

type Config

type Config struct {
	ServerPort string `json:"server_port"`

	IotUrl           string `json:"iot_url"`
	ConnectionLogUrl string `json:"connection_log_url"`
	PermissionsUrl   string `json:"permissions_url"`

	CamundaWrapperUrl                string `json:"camunda_wrapper_url"`
	ProcessDeploymentUrl             string `json:"process_deployment_url"`
	EventManagerUrl                  string `json:"event_manager_url"`
	UseAnnotationsForConnectionState bool   `json:"use_annotations_for_connection_state"`
	HttpClientTimeout                string `json:"http_client_timeout"`
}

func LoadConfig

func LoadConfig(location string) (config Config, err error)

type Dependencies

type Dependencies struct {
	DeploymentId string             `json:"deployment_id" bson:"deployment_id"`
	Owner        string             `json:"owner" bson:"owner"`
	Devices      []DeviceDependency `json:"devices" bson:"devices"`
	Events       []EventDependency  `json:"events" bson:"events"`
	Online       bool               `json:"-"`
}

type DeviceDependency

type DeviceDependency struct {
	DeviceId      string         `json:"device_id" bson:"device_id"`
	Name          string         `json:"name" bson:"name"`
	BpmnResources []BpmnResource `json:"bpmn_resources" bson:"bpmn_resources"`
	Online        bool           `json:"-"`
}

type EventDependency

type EventDependency struct {
	EventId       string         `json:"event_id" bson:"event_id"`
	BpmnResources []BpmnResource `json:"bpmn_resources" bson:"bpmn_resources"`
	Online        bool           `json:"-"`
}

type Function

type Function struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	ConceptId   string `json:"concept_id"`
	RdfType     string `json:"rdf_type"`
}

type HistoryResult

type HistoryResult struct {
	Series []HistorySeries `json:"Series"`
}

type HistorySeries

type HistorySeries struct {
	Name    string            `json:"name"`
	Tags    map[string]string `json:"tags"`
	Columns []string          `json:"columns"`
	Values  [][]interface{}   `json:"values"`
}

type ImportTypePermissionSearch

type ImportTypePermissionSearch struct {
	AspectFunctions    []string `json:"aspect_functions"`
	ContentAspectIds   []string `json:"content_aspect_ids"`
	Creator            string   `json:"creator"`
	DefaultRestart     bool     `json:"default_restart"`
	Description        string   `json:"description"`
	ContentFunctionIds []string `json:"content_function_ids"`
	Id                 string   `json:"id"`
	Image              string   `json:"image"`
	Name               string   `json:"name"`
	PermissionHolders  struct {
		AdminUsers   []string `json:"admin_users"`
		ExecuteUsers []string `json:"execute_users"`
		ReadUsers    []string `json:"read_users"`
		WriteUsers   []string `json:"write_users"`
	} `json:"permission_holders"`
	Permissions struct {
		A bool `json:"a"`
		R bool `json:"r"`
		W bool `json:"w"`
		X bool `json:"x"`
	} `json:"permissions"`
	Shared bool `json:"shared"`
}

type Interface

type Interface interface {
	Config() Config
	SortByName(input []map[string]interface{}, sortAsc bool) (output []map[string]interface{})
	FilterDevicesByState(token auth.Token, devices []map[string]interface{}, state string) (result []map[string]interface{}, err error)
	CompleteDevices(token auth.Token, ids []string) (result []map[string]interface{}, err error)
	CompleteDevicesOrdered(token auth.Token, ids []string, limit string, offset string, orderfeature string, direction string) (result []map[string]interface{}, err error)
	GetGatewaysHistory(token auth.Token, duration string) (result []map[string]interface{}, err error)
	ListGateways(token auth.Token, limit string, offset string) (result []map[string]interface{}, err error)
	SearchGateways(token auth.Token, query string, limit string, offset string) (result []map[string]interface{}, err error)
	ListGatewaysOrdered(token auth.Token, limit string, offset string, orderfeature string, direction string) (result []map[string]interface{}, err error)
	SearchGatewaysOrdered(token auth.Token, query string, limit string, offset string, orderfeature string, direction string) (result []map[string]interface{}, err error)
	GetExtendedProcessList(token auth.Token, query url.Values) (result []map[string]interface{}, err error)
	CompleteDeviceHistory(token auth.Token, duration string, devices []map[string]interface{}) (result []map[string]interface{}, err error)
	CompleteGatewayHistory(token auth.Token, duration string, devices []map[string]interface{}) (result []map[string]interface{}, err error)
	ListAllGateways(token auth.Token) (result []map[string]interface{}, err error)
	GetGatewayDevices(token auth.Token, id string) (ids []string, err error)
	GetDeviceTypeDevices(token auth.Token, id string, limit string, offset string, orderFeature string, direction string) (ids []string, err error)
	FindDevices(token auth.Token, search string, list []string, limit int, offset int, orderfeature string, direction string, location string, state string) ([]map[string]interface{}, error)
	FindDevicesAfter(token auth.Token, search string, list []string, limit int, afterId string, orderfeature string, direction string, location string, state string) ([]map[string]interface{}, error)
	GetMeasuringFunctionsForAspect(token auth.Token, aspectId string) (functions []Function, err error, code int)
	GetMeasuringFunctions(token auth.Token, functionIds []string) (functions []Function, err error, code int)
	GetImportTypesWithAspect(token auth.Token, aspectIds []string) (importTypes []ImportTypePermissionSearch, err error, code int)
	GetNestedFunctionInfos(token auth.Token) (result []model.FunctionInfo, err error)
	GetAspectNodes(ids []string, token auth.Token) ([]model.AspectNode, error)
	GetAspectNodesWithMeasuringFunction(token auth.Token) ([]model.AspectNode, error)
	GetImportTypes(token auth.Token) (importTypes []ImportTypePermissionSearch, err error, code int)
	GetDeviceClassUses(token auth.Token) (result interface{}, err error)
}

type Lib

type Lib struct {
	// contains filtered or unexported fields
}

func New

func New(config Config) *Lib

func (*Lib) CheckEventStates

func (this *Lib) CheckEventStates(token string, ids []string) (result map[string]bool, err error)

func (*Lib) CompleteDeviceHistory

func (this *Lib) CompleteDeviceHistory(token auth.Token, duration string, devices []map[string]interface{}) (result []map[string]interface{}, err error)

func (*Lib) CompleteDevices

func (this *Lib) CompleteDevices(token auth.Token, ids []string) (result []map[string]interface{}, err error)

func (*Lib) CompleteDevicesOrdered

func (this *Lib) CompleteDevicesOrdered(token auth.Token, ids []string, limit string, offset string, orderfeature string, direction string) (result []map[string]interface{}, err error)

func (*Lib) CompleteGatewayHistory

func (this *Lib) CompleteGatewayHistory(token auth.Token, duration string, gateways []map[string]interface{}) (result []map[string]interface{}, err error)

func (*Lib) Config

func (this *Lib) Config() Config

func (*Lib) FilterDevicesByState

func (this *Lib) FilterDevicesByState(token auth.Token, devices []map[string]interface{}, state string) (result []map[string]interface{}, err error)

func (*Lib) FindDevices

func (this *Lib) FindDevices(token auth.Token, search string, deviceIds []string, limit int, offset int, orderfeature string, direction string, location string, state string) (devices []map[string]interface{}, err error)

func (*Lib) FindDevicesAfter

func (this *Lib) FindDevicesAfter(token auth.Token, search string, deviceIds []string, limit int, afterId string, orderfeature string, direction string, location string, state string) ([]map[string]interface{}, error)

func (*Lib) FindDevicesCommon

func (this *Lib) FindDevicesCommon(token auth.Token, search string, deviceIds []string, queryCommons QueryListCommons, location string, state string) (devices []map[string]interface{}, err error)

func (*Lib) GetAspectNodes

func (this *Lib) GetAspectNodes(ids []string, token auth.Token) ([]model.AspectNode, error)

func (*Lib) GetAspectNodesWithMeasuringFunction

func (this *Lib) GetAspectNodesWithMeasuringFunction(token auth.Token) ([]model.AspectNode, error)

func (*Lib) GetDeviceClassUses

func (this *Lib) GetDeviceClassUses(token auth.Token) (result interface{}, err error)

func (*Lib) GetDeviceLogHistory

func (this *Lib) GetDeviceLogHistory(token auth.Token, deviceIds []string, duration string) (result map[string]HistorySeries, err error)

func (*Lib) GetDeviceLogStates

func (this *Lib) GetDeviceLogStates(token auth.Token, deviceIds []string) (result map[string]bool, err error)

func (*Lib) GetDeviceTypeDevices

func (this *Lib) GetDeviceTypeDevices(token auth.Token, id string, limit string, offset string, orderFeature string, direction string) (ids []string, err error)

func (*Lib) GetDevicesInLocation

func (this *Lib) GetDevicesInLocation(token auth.Token, location string) (deviceIds []string, err error)

func (*Lib) GetExtendedProcessList

func (this *Lib) GetExtendedProcessList(token auth.Token, query url.Values) (result []map[string]interface{}, err error)

func (*Lib) GetGatewayDevices

func (this *Lib) GetGatewayDevices(token auth.Token, id string) (ids []string, err error)

func (*Lib) GetGatewayLogHistory

func (this *Lib) GetGatewayLogHistory(token auth.Token, ids []string, duration string) (result map[string]HistorySeries, err error)

func (*Lib) GetGatewayLogStates

func (this *Lib) GetGatewayLogStates(token auth.Token, ids []string) (result map[string]bool, err error)

func (*Lib) GetGatewaysHistory

func (this *Lib) GetGatewaysHistory(token auth.Token, duration string) (result []map[string]interface{}, err error)

func (*Lib) GetImportTypes

func (this *Lib) GetImportTypes(token auth.Token) (importTypes []ImportTypePermissionSearch, err error, code int)

func (*Lib) GetImportTypesWithAspect

func (this *Lib) GetImportTypesWithAspect(token auth.Token, aspectIds []string) (importTypes []ImportTypePermissionSearch, err error, code int)

func (*Lib) GetLocations

func (this *Lib) GetLocations(token auth.Token, locationIds []string) (locations []Location, err error)

func (*Lib) GetLogHistory

func (this *Lib) GetLogHistory(token auth.Token, kind string, ids []string, duration string) (result map[string]HistorySeries, err error)

func (*Lib) GetLogedges

func (this *Lib) GetLogedges(token auth.Token, kind string, ids []string, duration string) (result map[string]interface{}, err error)

func (*Lib) GetLogstarts

func (this *Lib) GetLogstarts(token auth.Token, kind string, ids []string) (result map[string]interface{}, err error)

func (*Lib) GetMeasuringFunctions

func (this *Lib) GetMeasuringFunctions(token auth.Token, functionIds []string) (functions []Function, err error, code int)

func (*Lib) GetMeasuringFunctionsForAspect

func (this *Lib) GetMeasuringFunctionsForAspect(token auth.Token, aspectId string) (functions []Function, err error, code int)

func (*Lib) GetNestedFunctionInfos

func (this *Lib) GetNestedFunctionInfos(token auth.Token) (result []model.FunctionInfo, err error)

func (*Lib) GetProcessDependencyList

func (this *Lib) GetProcessDependencyList(token auth.Token, processIds []string) (result []Dependencies, err error)

func (*Lib) GetProcessDeploymentList

func (this *Lib) GetProcessDeploymentList(token auth.Token, query url.Values) (result []map[string]interface{}, err error)

func (*Lib) ListAllGateways

func (this *Lib) ListAllGateways(token auth.Token) (result []map[string]interface{}, err error)

func (*Lib) ListGateways

func (this *Lib) ListGateways(token auth.Token, limit string, offset string) (result []map[string]interface{}, err error)

func (*Lib) ListGatewaysOrdered

func (this *Lib) ListGatewaysOrdered(token auth.Token, limit string, offset string, orderfeature string, direction string) (result []map[string]interface{}, err error)

func (*Lib) PermCheck

func (this *Lib) PermCheck(token auth.Token, kind string, ids []string, right string) (result map[string]bool, err error)

func (*Lib) PermCheckDeviceAdmin

func (this *Lib) PermCheckDeviceAdmin(token auth.Token, ids []string) (result map[string]bool, err error)

func (*Lib) PermCheckDeviceRead

func (this *Lib) PermCheckDeviceRead(token auth.Token, ids []string) (result map[string]bool, err error)

func (*Lib) PermDeviceIdList

func (this *Lib) PermDeviceIdList(token auth.Token, ids []string, right string) (result []map[string]interface{}, err error)

func (*Lib) PermDeviceIdListOrdered

func (this *Lib) PermDeviceIdListOrdered(token auth.Token, ids []string, right string, limit string, offset string, orderfeature string, direction string) (result []map[string]interface{}, err error)

func (*Lib) PermIdListOrdered

func (this *Lib) PermIdListOrdered(token auth.Token, kind string, ids []string, right string, limit string, offset string, orderfeature string, direction string) (result []map[string]interface{}, err error)

func (*Lib) PermList

func (this *Lib) PermList(token auth.Token, kind string, right string, limit string, offset string) (result []map[string]interface{}, err error)

func (*Lib) PermListAll

func (this *Lib) PermListAll(token auth.Token, kind string, right string) (result []map[string]interface{}, err error)

func (*Lib) PermListAllGateways

func (this *Lib) PermListAllGateways(token auth.Token, right string) (result []map[string]interface{}, err error)

func (*Lib) PermListGateways

func (this *Lib) PermListGateways(token auth.Token, right string, limit string, offset string) (result []map[string]interface{}, err error)

func (*Lib) PermListGatewaysOrdered

func (this *Lib) PermListGatewaysOrdered(token auth.Token, right string, limit string, offset string, orderfeature string, direction string) (result []map[string]interface{}, err error)

func (*Lib) PermListOrdered

func (this *Lib) PermListOrdered(token auth.Token, kind string, right string, limit string, offset string, orderfeature string, direction string) (result []map[string]interface{}, err error)

func (*Lib) PermSearch

func (this *Lib) PermSearch(token auth.Token, kind string, query string, right string, limit string, offset string) (result []map[string]interface{}, err error)

func (*Lib) PermSearchGateways

func (this *Lib) PermSearchGateways(token auth.Token, query string, right string, limit string, offset string) (result []map[string]interface{}, err error)

func (*Lib) PermSearchGatewaysOrdered

func (this *Lib) PermSearchGatewaysOrdered(token auth.Token, query string, right string, limit string, offset string, orderfeature string, direction string) (result []map[string]interface{}, err error)

func (*Lib) PermSearchOrdered

func (this *Lib) PermSearchOrdered(token auth.Token, kind string, query string, right string, limit string, offset string, orderfeature string, direction string) (result []map[string]interface{}, err error)

func (*Lib) PermSelectDeviceTypesByIdRead

func (this *Lib) PermSelectDeviceTypesByIdRead(token auth.Token, ids []string) (result []map[string]interface{}, err error)

func (*Lib) PermSelectIds

func (this *Lib) PermSelectIds(token auth.Token, kind string, right string, ids []string) (result []map[string]interface{}, err error)

func (*Lib) QueryPermissionsSearch

func (this *Lib) QueryPermissionsSearch(token string, query QueryMessage, result interface{}) (err error, code int)

func (*Lib) SearchGateways

func (this *Lib) SearchGateways(token auth.Token, query string, limit string, offset string) (result []map[string]interface{}, err error)

func (*Lib) SearchGatewaysOrdered

func (this *Lib) SearchGatewaysOrdered(token auth.Token, query string, limit string, offset string, orderfeature string, direction string) (result []map[string]interface{}, err error)

func (*Lib) SetOnlineState

func (this *Lib) SetOnlineState(token auth.Token, dependencies []Dependencies) (result []Dependencies, err error)

func (*Lib) SortByName

func (this *Lib) SortByName(input []map[string]interface{}, sortAsc bool) (output []map[string]interface{})

type ListAfter

type ListAfter = client.ListAfter

type Location

type Location struct {
	Id             string   `json:"id"`
	Name           string   `json:"name"`
	Description    string   `json:"description"`
	Image          string   `json:"image"`
	DeviceIds      []string `json:"device_ids"`
	DeviceGroupIds []string `json:"device_group_ids"`
	RdfType        string   `json:"rdf_type"`
}

type OfflineReason

type OfflineReason struct {
	Type           string      `json:"type"`
	Id             string      `json:"id"`
	AdditionalInfo interface{} `json:"additional_info,omitempty"`
	Description    string      `json:"description"`
}

type QueryCheckIds

type QueryCheckIds = client.QueryCheckIds

type QueryFind

type QueryFind = client.QueryFind

type QueryListCommons

type QueryListCommons = client.QueryListCommons

type QueryListIds

type QueryListIds = client.QueryListIds

type QueryMessage

type QueryMessage = client.QueryMessage

type QueryOperationType

type QueryOperationType = client.QueryOperationType

type Selection

type Selection = client.Selection

Directories

Path Synopsis
api
tests

Jump to

Keyboard shortcuts

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