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
- type DeviceManagementService
- func (s *DeviceManagementService) AddDevice(ctx context.Context, in *pb.AddDeviceRequest) (*pb.AddDeviceResponse, error)
- func (s *DeviceManagementService) CreateDeviceModel(ctx context.Context, in *pb.CreateDeviceModelRequest) (*pb.CreateDeviceModelResponse, error)
- func (s *DeviceManagementService) DeleteDevice(ctx context.Context, in *pb.DeleteDeviceRequest) (*pb.DeleteDeviceResponse, error)
- func (s *DeviceManagementService) DeleteDeviceModel(ctx context.Context, in *pb.DeleteDeviceModelRequest) (*pb.DeleteDeviceModelResponse, error)
- func (s *DeviceManagementService) GetDevice(ctx context.Context, in *pb.GetDeviceRequest) (*pb.GetDeviceResponse, error)
- func (s *DeviceManagementService) GetDeviceLog(ctx context.Context, in *pb.GetDeviceLogRequest) (*pb.GetDeviceLogResponse, error)
- func (s *DeviceManagementService) GetDeviceMetrics(ctx context.Context, in *pb.GetDeviceMetricsRequest) (*pb.GetDeviceMetricsResponse, error)
- func (s *DeviceManagementService) GetDeviceModel(ctx context.Context, in *pb.GetDeviceModelRequest) (*pb.GetDeviceModelResponse, error)
- func (s *DeviceManagementService) GetDeviceModelWithName(ctx context.Context, in *pb.GetDeviceModelWithNameRequest) (*pb.GetDeviceModelWithNameResponse, error)
- func (s *DeviceManagementService) GetDeviceModels(ctx context.Context, in *pb.GetDeviceModelsRequest) (*pb.GetDeviceModelsResponse, error)
- func (s *DeviceManagementService) GetDevices(ctx context.Context, in *pb.GetDevicesRequest) (*pb.GetDevicesResponse, error)
- func (s *DeviceManagementService) Initialize(servingOptions *ServingOptions)
- func (s *DeviceManagementService) Onbroadcast(b broadcast.Broadcast, notify broadcast.Notification)
- func (s *DeviceManagementService) PostDeviceMessage(ctx context.Context, in *pb.PostDeviceMessageRequest) (*pb.PostDeviceMessageResponse, error)
- func (s *DeviceManagementService) SetDeviceStatus(ctx context.Context, in *pb.SetDeviceStatusRequest) (*pb.SetDeviceStatusResponse, error)
- func (s *DeviceManagementService) UpdateDevice(ctx context.Context, in *pb.UpdateDeviceRequest) (*pb.UpdateDeviceResponse, error)
- func (s *DeviceManagementService) UpdateDeviceModel(ctx context.Context, in *pb.UpdateDeviceModelRequest) (*pb.UpdateDeviceModelResponse, error)
- type DeviceNotification
- type DeviceUpdater
- type ServingOptions
Constants ¶
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 ¶
func (s *DeviceManagementService) AddDevice(ctx context.Context, in *pb.AddDeviceRequest) (*pb.AddDeviceResponse, error)
AddDevice add new device into dmms and broadcast the action
func (*DeviceManagementService) CreateDeviceModel ¶
func (s *DeviceManagementService) CreateDeviceModel(ctx context.Context, in *pb.CreateDeviceModelRequest) (*pb.CreateDeviceModelResponse, error)
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 ¶
func (s *DeviceManagementService) DeleteDevice(ctx context.Context, in *pb.DeleteDeviceRequest) (*pb.DeleteDeviceResponse, error)
DeleteDevice will remove specified device from dmms
func (*DeviceManagementService) DeleteDeviceModel ¶
func (s *DeviceManagementService) DeleteDeviceModel(ctx context.Context, in *pb.DeleteDeviceModelRequest) (*pb.DeleteDeviceModelResponse, error)
DeleteDeviceModel delete specified device model
func (*DeviceManagementService) GetDevice ¶
func (s *DeviceManagementService) GetDevice(ctx context.Context, in *pb.GetDeviceRequest) (*pb.GetDeviceResponse, error)
GetDevice return specified device
func (*DeviceManagementService) GetDeviceLog ¶
func (s *DeviceManagementService) GetDeviceLog(ctx context.Context, in *pb.GetDeviceLogRequest) (*pb.GetDeviceLogResponse, error)
GetDeviceLog return spcecified device's log
func (*DeviceManagementService) GetDeviceMetrics ¶
func (s *DeviceManagementService) GetDeviceMetrics(ctx context.Context, in *pb.GetDeviceMetricsRequest) (*pb.GetDeviceMetricsResponse, error)
GetDeviceMetrics return device metrics
func (*DeviceManagementService) GetDeviceModel ¶
func (s *DeviceManagementService) GetDeviceModel(ctx context.Context, in *pb.GetDeviceModelRequest) (*pb.GetDeviceModelResponse, error)
GetDeviceModel return specifed device model's detail
func (*DeviceManagementService) GetDeviceModelWithName ¶
func (s *DeviceManagementService) GetDeviceModelWithName(ctx context.Context, in *pb.GetDeviceModelWithNameRequest) (*pb.GetDeviceModelWithNameResponse, error)
GetDeviceModelWithName return device model specified with model name
func (*DeviceManagementService) GetDeviceModels ¶
func (s *DeviceManagementService) GetDeviceModels(ctx context.Context, in *pb.GetDeviceModelsRequest) (*pb.GetDeviceModelsResponse, error)
GetDeviceModels return user's all device models
func (*DeviceManagementService) GetDevices ¶
func (s *DeviceManagementService) GetDevices(ctx context.Context, in *pb.GetDevicesRequest) (*pb.GetDevicesResponse, error)
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 ¶
func (s *DeviceManagementService) Onbroadcast(b broadcast.Broadcast, notify broadcast.Notification)
Onbroadcast handle notifications received from other component service
func (*DeviceManagementService) PostDeviceMessage ¶
func (s *DeviceManagementService) PostDeviceMessage(ctx context.Context, in *pb.PostDeviceMessageRequest) (*pb.PostDeviceMessageResponse, error)
PostDeviceMessage post a message to specified device on endpoint
func (*DeviceManagementService) SetDeviceStatus ¶
func (s *DeviceManagementService) SetDeviceStatus(ctx context.Context, in *pb.SetDeviceStatusRequest) (*pb.SetDeviceStatusResponse, error)
SetDeviceStatus change device status and trigger related actions
func (*DeviceManagementService) UpdateDevice ¶
func (s *DeviceManagementService) UpdateDevice(ctx context.Context, in *pb.UpdateDeviceRequest) (*pb.UpdateDeviceResponse, error)
UpdateDevice update specified device
func (*DeviceManagementService) UpdateDeviceModel ¶
func (s *DeviceManagementService) UpdateDeviceModel(ctx context.Context, in *pb.UpdateDeviceModelRequest) (*pb.UpdateDeviceModelResponse, error)
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
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
Source Files ¶
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. |