dmms

package
v0.0.0-...-7077701 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	KDeviceConnected       = "DEVICE_CONNECTED"
	KDeviceDisconnected    = "DEVICE_DISCONNECTED"
	KDeviceMessageReceived = "DEVICE_MESSAGE_RECEIVED"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceManagementService

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

DeviceManager manage all device and device models which include model definition and presentation. Model definition and presentation are wrapped into bundle to store into backend storage.

func NewDeviceManagementService

func NewDeviceManagementService() *DeviceManagementService

func (*DeviceManagementService) AddDevice

AddDevice add new device into dmms and broadcast the action

func (*DeviceManagementService) CreateDeviceModel

CreateDeviceModel create device model with device model bundle, After user create device model using web-console, as for user, the device model should be created, the creation includ model definition creation and model presentation saving User can also using the method to create device model with inmemory bundle, for this case, the device should also be save to repo

func (*DeviceManagementService) DeleteDevice

DeleteDevice will remove specified device from dmms

func (*DeviceManagementService) DeleteDeviceModel

DeleteDeviceModel delete specified device model

func (*DeviceManagementService) GetDevice

GetDevice return specified device

func (*DeviceManagementService) GetDeviceLog

GetDeviceLog return spcecified device's log

func (*DeviceManagementService) GetDeviceMetrics

GetDeviceMetrics return device metrics

func (*DeviceManagementService) GetDeviceModel

GetDeviceModel return specifed device model's detail

func (*DeviceManagementService) GetDeviceModelWithName

GetDeviceModelWithName return device model specified with model name

func (*DeviceManagementService) GetDeviceModels

GetDeviceModels return user's all device models

func (*DeviceManagementService) GetDevices

GetDevices return user's all devices

func (*DeviceManagementService) Initialize

func (s *DeviceManagementService) Initialize(servingOptions *ServingOptions)

Prerun initialize and load builtin devices models

func (*DeviceManagementService) Onbroadcast

Onbroadcast handle notifications received from other component service

func (*DeviceManagementService) PostDeviceMessage

PostDeviceMessage post a message to specified device on endpoint

func (*DeviceManagementService) SetDeviceStatus

SetDeviceStatus change device status and trigger related actions

func (*DeviceManagementService) UpdateDevice

UpdateDevice update specified device

func (*DeviceManagementService) UpdateDeviceModel

UpdateDeviceModel is called when model presentation is changed using web console, the model definition can not be changed without using presentation in web console

type DeviceNotification

type DeviceNotification struct {
	UserID     string `json:"userID"`
	DeviceID   string `json:"deviceID"`
	DeviceName string `json:"deviceName"`
	Type       string `json:"type"`
	Endpoint   string `json:"endpoint"`
	Payload    []byte `json:"payload"`
}

DeviceNotification DeviceNotification

func (*DeviceNotification) MarshalBinary

func (m *DeviceNotification) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*DeviceNotification) UnmarshalBinary

func (m *DeviceNotification) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*DeviceNotification) Validate

func (m *DeviceNotification) Validate(formats strfmt.Registry) error

Validate validates this deployment

type DeviceUpdater

type DeviceUpdater struct{}

func NewDeviceUpdater

func NewDeviceUpdater() *DeviceUpdater

func (*DeviceUpdater) UpdateDeviceMetrics

func (u *DeviceUpdater) UpdateDeviceMetrics(n *DeviceNotification)

UpdateDeviceMetrics update device metrics

func (*DeviceUpdater) UpdateDeviceStatus

func (u *DeviceUpdater) UpdateDeviceStatus(n *DeviceNotification)

UpdateDeviceStatus update device status

func (*DeviceUpdater) UpdateDeviceValues

func (*DeviceUpdater) UpdateDeviceValues(n *DeviceNotification)

UpdateDeviceValues will update device real values using message received and device model

type ServingOptions

type ServingOptions struct {
	ServingOptions  *modeloptions.ServingOptions
	DeviceModelPath string
}

ServingOptions

func NewServingOptions

func NewServingOptions() *ServingOptions

func (*ServingOptions) AddFlags

func (s *ServingOptions) AddFlags(fs *pflag.FlagSet)

func (*ServingOptions) Validate

func (s *ServingOptions) Validate() []error

Directories

Path Synopsis
Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License.

Jump to

Keyboard shortcuts

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