Documentation ¶
Index ¶
- Constants
- Variables
- func CreateDescriptorsFromProfile(profile contract.DeviceProfile) error
- type AddressableClientMock
- func (AddressableClientMock) Add(addr *contract.Addressable, ctx context.Context) (string, error)
- func (AddressableClientMock) Addressable(id string, ctx context.Context) (contract.Addressable, error)
- func (AddressableClientMock) AddressableForName(name string, ctx context.Context) (contract.Addressable, error)
- func (AddressableClientMock) Delete(id string, ctx context.Context) error
- func (AddressableClientMock) Update(addr contract.Addressable, ctx context.Context) error
- type DeviceClientMock
- func (dc *DeviceClientMock) Add(dev *contract.Device, ctx context.Context) (string, error)
- func (dc *DeviceClientMock) CheckForDevice(token string, ctx context.Context) (contract.Device, error)
- func (dc *DeviceClientMock) Delete(id string, ctx context.Context) error
- func (dc *DeviceClientMock) DeleteByName(name string, ctx context.Context) error
- func (dc *DeviceClientMock) Device(id string, ctx context.Context) (contract.Device, error)
- func (dc *DeviceClientMock) DeviceForName(name string, ctx context.Context) (contract.Device, error)
- func (dc *DeviceClientMock) Devices(ctx context.Context) ([]contract.Device, error)
- func (dc *DeviceClientMock) DevicesByLabel(label string, ctx context.Context) ([]contract.Device, error)
- func (dc *DeviceClientMock) DevicesForProfile(profileid string, ctx context.Context) ([]contract.Device, error)
- func (dc *DeviceClientMock) DevicesForProfileByName(profileName string, ctx context.Context) ([]contract.Device, error)
- func (dc *DeviceClientMock) DevicesForService(serviceid string, ctx context.Context) ([]contract.Device, error)
- func (dc *DeviceClientMock) DevicesForServiceByName(serviceName string, ctx context.Context) ([]contract.Device, error)
- func (dc *DeviceClientMock) Update(dev contract.Device, ctx context.Context) error
- func (dc *DeviceClientMock) UpdateAdminState(id string, adminState string, ctx context.Context) error
- func (dc *DeviceClientMock) UpdateAdminStateByName(name string, adminState string, ctx context.Context) error
- func (dc *DeviceClientMock) UpdateLastConnected(id string, time int64, ctx context.Context) error
- func (dc *DeviceClientMock) UpdateLastConnectedByName(name string, time int64, ctx context.Context) error
- func (dc *DeviceClientMock) UpdateLastReported(id string, time int64, ctx context.Context) error
- func (dc *DeviceClientMock) UpdateLastReportedByName(name string, time int64, ctx context.Context) error
- func (dc *DeviceClientMock) UpdateOpState(id string, opState string, ctx context.Context) error
- func (dc *DeviceClientMock) UpdateOpStateByName(name string, opState string, ctx context.Context) error
- type DeviceProfileClientMock
- func (DeviceProfileClientMock) Add(dp *contract.DeviceProfile, ctx context.Context) (string, error)
- func (DeviceProfileClientMock) Delete(id string, ctx context.Context) error
- func (DeviceProfileClientMock) DeleteByName(name string, ctx context.Context) error
- func (DeviceProfileClientMock) DeviceProfile(id string, ctx context.Context) (contract.DeviceProfile, error)
- func (DeviceProfileClientMock) DeviceProfileForName(name string, ctx context.Context) (contract.DeviceProfile, error)
- func (DeviceProfileClientMock) DeviceProfiles(ctx context.Context) ([]contract.DeviceProfile, error)
- func (DeviceProfileClientMock) Update(dp contract.DeviceProfile, ctx context.Context) error
- func (DeviceProfileClientMock) Upload(yamlString string, ctx context.Context) (string, error)
- func (DeviceProfileClientMock) UploadFile(yamlFilePath string, ctx context.Context) (string, error)
- type DriverMock
- func (DriverMock) AddDevice(deviceName string, protocols map[string]contract.ProtocolProperties, ...) error
- func (DriverMock) DisconnectDevice(deviceName string, protocols map[string]contract.ProtocolProperties) error
- func (DriverMock) HandleReadCommands(deviceName string, protocols map[string]contract.ProtocolProperties, ...) (res []*dsModels.CommandValue, err error)
- func (DriverMock) HandleWriteCommands(deviceName string, protocols map[string]contract.ProtocolProperties, ...) error
- func (DriverMock) Initialize(lc logger.LoggingClient, asyncCh chan<- *dsModels.AsyncValues) error
- func (DriverMock) RemoveDevice(deviceName string, protocols map[string]contract.ProtocolProperties) error
- func (DriverMock) Stop(force bool) error
- func (DriverMock) UpdateDevice(deviceName string, protocols map[string]contract.ProtocolProperties, ...) error
- type EventClientMock
- func (EventClientMock) Add(event *contract.Event, ctx context.Context) (string, error)
- func (EventClientMock) AddBytes(event []byte, ctx context.Context) (string, error)
- func (EventClientMock) Delete(id string, ctx context.Context) error
- func (EventClientMock) DeleteForDevice(id string, ctx context.Context) error
- func (EventClientMock) DeleteOld(age int, ctx context.Context) error
- func (EventClientMock) Event(id string, ctx context.Context) (contract.Event, error)
- func (EventClientMock) EventCount(ctx context.Context) (int, error)
- func (EventClientMock) EventCountForDevice(deviceId string, ctx context.Context) (int, error)
- func (EventClientMock) Events(ctx context.Context) ([]contract.Event, error)
- func (EventClientMock) EventsForDevice(id string, limit int, ctx context.Context) ([]contract.Event, error)
- func (EventClientMock) EventsForDeviceAndValueDescriptor(deviceId string, vd string, limit int, ctx context.Context) ([]contract.Event, error)
- func (EventClientMock) EventsForInterval(start int, end int, limit int, ctx context.Context) ([]contract.Event, error)
- func (EventClientMock) MarkPushed(id string, ctx context.Context) error
- func (EventClientMock) MarkPushedByChecksum(id string, ctx context.Context) error
- func (EventClientMock) MarshalEvent(e contract.Event) ([]byte, error)
- type ProvisionWatcherClientMock
- func (ProvisionWatcherClientMock) Add(dev *contract.ProvisionWatcher, ctx context.Context) (string, error)
- func (ProvisionWatcherClientMock) Delete(id string, ctx context.Context) error
- func (ProvisionWatcherClientMock) ProvisionWatcher(id string, ctx context.Context) (contract.ProvisionWatcher, error)
- func (ProvisionWatcherClientMock) ProvisionWatcherForName(name string, ctx context.Context) (contract.ProvisionWatcher, error)
- func (ProvisionWatcherClientMock) ProvisionWatchers(ctx context.Context) ([]contract.ProvisionWatcher, error)
- func (ProvisionWatcherClientMock) ProvisionWatchersForProfile(profileId string, ctx context.Context) ([]contract.ProvisionWatcher, error)
- func (ProvisionWatcherClientMock) ProvisionWatchersForProfileByName(profileName string, ctx context.Context) ([]contract.ProvisionWatcher, error)
- func (ProvisionWatcherClientMock) ProvisionWatchersForService(serviceId string, ctx context.Context) ([]contract.ProvisionWatcher, error)
- func (ProvisionWatcherClientMock) ProvisionWatchersForServiceByName(serviceName string, ctx context.Context) ([]contract.ProvisionWatcher, error)
- func (ProvisionWatcherClientMock) Update(dev contract.ProvisionWatcher, ctx context.Context) error
- type ValueDescriptorMock
- func (ValueDescriptorMock) Add(vdr *contract.ValueDescriptor, ctx context.Context) (string, error)
- func (ValueDescriptorMock) Delete(id string, ctx context.Context) error
- func (ValueDescriptorMock) DeleteByName(name string, ctx context.Context) error
- func (ValueDescriptorMock) Update(vdr *contract.ValueDescriptor, ctx context.Context) error
- func (ValueDescriptorMock) ValueDescriptor(id string, ctx context.Context) (contract.ValueDescriptor, error)
- func (ValueDescriptorMock) ValueDescriptorForName(name string, ctx context.Context) (contract.ValueDescriptor, error)
- func (ValueDescriptorMock) ValueDescriptors(ctx context.Context) ([]contract.ValueDescriptor, error)
- func (ValueDescriptorMock) ValueDescriptorsByLabel(label string, ctx context.Context) ([]contract.ValueDescriptor, error)
- func (ValueDescriptorMock) ValueDescriptorsByUomLabel(uomLabel string, ctx context.Context) ([]contract.ValueDescriptor, error)
- func (ValueDescriptorMock) ValueDescriptorsForDevice(deviceId string, ctx context.Context) ([]contract.ValueDescriptor, error)
- func (ValueDescriptorMock) ValueDescriptorsForDeviceByName(deviceName string, ctx context.Context) ([]contract.ValueDescriptor, error)
- func (ValueDescriptorMock) ValueDescriptorsUsage(names []string, ctx context.Context) (map[string]bool, error)
Constants ¶
View Source
const ( DeviceBool = "Random-Boolean-Generator" DeviceInt = "Random-Integer-Generator" DeviceUint = "Random-UnsignedInteger-Generator" DeviceFloat = "Random-Float-Generator" DeviceNew = "New-Device" DeviceNew02 = "New-Device-02" ProfileBool = "Random-Boolean-Generator" ProfileInt = "Random-Integer-Generator" ProfileUint = "Random-UnsignedInteger-Generator" ProfileFloat = "Random-Float-Generator" ProfileNew = "New-Device" WatcherBool = "Bool-Watcher" WatcherInt = "Integer-Watcher" WatcherUint = "UnsignedInteger-Watcher" WatcherFloat = "Float-Watcher" WatcherNew = "New-Watcher" ResourceObjectBool = "RandomValue_Bool" ResourceObjectInt8 = "RandomValue_Int8" ResourceObjectInt16 = "RandomValue_Int16" ResourceObjectInt32 = "RandomValue_Int32" ResourceObjectInt64 = "RandomValue_Int64" ResourceObjectUint8 = "RandomValue_Uint8" ResourceObjectUint16 = "RandomValue_Uint16" ResourceObjectUint32 = "RandomValue_Uint32" ResourceObjectUint64 = "RandomValue_Uint64" ResourceObjectFloat32 = "RandomValue_Float32" ResourceObjectFloat64 = "RandomValue_Float64" ResourceObjectRandFloat32 = "randfloat32" )
View Source
const Int8Value = int8(123)
View Source
const (
InvalidDeviceId = "1ef435eb-5060-49b0-8d55-8d4e43239800"
)
Variables ¶
View Source
var ( ValidDeviceRandomBoolGenerator = contract.Device{} ValidDeviceRandomIntegerGenerator = contract.Device{} ValidDeviceRandomUnsignedIntegerGenerator = contract.Device{} ValidDeviceRandomFloatGenerator = contract.Device{} DuplicateDeviceRandomFloatGenerator = contract.Device{} NewValidDevice = contract.Device{} OperatingStateDisabled = contract.Device{} )
View Source
var ( DeviceProfileRandomBoolGenerator = contract.DeviceProfile{} DeviceProfileRandomIntegerGenerator = contract.DeviceProfile{} DeviceProfileRandomUnsignedGenerator = contract.DeviceProfile{} DeviceProfileRandomFloatGenerator = contract.DeviceProfile{} DuplicateDeviceProfileRandomFloatGenerator = contract.DeviceProfile{} NewDeviceProfile = contract.DeviceProfile{} )
View Source
var ( ValidBooleanWatcher = contract.ProvisionWatcher{} ValidIntegerWatcher = contract.ProvisionWatcher{} ValidUnsignedIntegerWatcher = contract.ProvisionWatcher{} ValidFloatWatcher = contract.ProvisionWatcher{} DuplicateFloatWatcher = contract.ProvisionWatcher{} NewProvisionWatcher = contract.ProvisionWatcher{} )
View Source
var ( ValueDescriptorEnableRandomization = contract.ValueDescriptor{} ValueDescriptorBool = contract.ValueDescriptor{} ValueDescriptorInt8 = contract.ValueDescriptor{} ValueDescriptorInt16 = contract.ValueDescriptor{} ValueDescriptorInt32 = contract.ValueDescriptor{} ValueDescriptorInt64 = contract.ValueDescriptor{} ValueDescriptorUint8 = contract.ValueDescriptor{} ValueDescriptorUint16 = contract.ValueDescriptor{} ValueDescriptorUint32 = contract.ValueDescriptor{} ValueDescriptorUint64 = contract.ValueDescriptor{} ValueDescriptorFloat32 = contract.ValueDescriptor{} ValueDescriptorFloat64 = contract.ValueDescriptor{} //ValueDescriptorString = contract.ValueDescriptor{} NewValueDescriptor = contract.ValueDescriptor{} DuplicateValueDescriptorInt16 = contract.ValueDescriptor{} )
Functions ¶
func CreateDescriptorsFromProfile ¶ added in v1.1.0
func CreateDescriptorsFromProfile(profile contract.DeviceProfile) error
Types ¶
type AddressableClientMock ¶
type AddressableClientMock struct { }
func (AddressableClientMock) Add ¶
func (AddressableClientMock) Add(addr *contract.Addressable, ctx context.Context) (string, error)
func (AddressableClientMock) Addressable ¶
func (AddressableClientMock) Addressable(id string, ctx context.Context) (contract.Addressable, error)
func (AddressableClientMock) AddressableForName ¶
func (AddressableClientMock) AddressableForName(name string, ctx context.Context) (contract.Addressable, error)
func (AddressableClientMock) Delete ¶
func (AddressableClientMock) Delete(id string, ctx context.Context) error
func (AddressableClientMock) Update ¶
func (AddressableClientMock) Update(addr contract.Addressable, ctx context.Context) error
type DeviceClientMock ¶
type DeviceClientMock struct{}
func (*DeviceClientMock) CheckForDevice ¶
func (*DeviceClientMock) Delete ¶
func (dc *DeviceClientMock) Delete(id string, ctx context.Context) error
func (*DeviceClientMock) DeleteByName ¶
func (dc *DeviceClientMock) DeleteByName(name string, ctx context.Context) error
func (*DeviceClientMock) DeviceForName ¶
func (*DeviceClientMock) DevicesByLabel ¶
func (*DeviceClientMock) DevicesForProfile ¶
func (*DeviceClientMock) DevicesForProfileByName ¶
func (*DeviceClientMock) DevicesForService ¶
func (*DeviceClientMock) DevicesForServiceByName ¶
func (*DeviceClientMock) UpdateAdminState ¶
func (*DeviceClientMock) UpdateAdminStateByName ¶
func (*DeviceClientMock) UpdateLastConnected ¶
func (*DeviceClientMock) UpdateLastConnectedByName ¶
func (*DeviceClientMock) UpdateLastReported ¶
func (*DeviceClientMock) UpdateLastReportedByName ¶
func (*DeviceClientMock) UpdateOpState ¶
func (*DeviceClientMock) UpdateOpStateByName ¶
type DeviceProfileClientMock ¶
type DeviceProfileClientMock struct{}
func (DeviceProfileClientMock) Add ¶
func (DeviceProfileClientMock) Add(dp *contract.DeviceProfile, ctx context.Context) (string, error)
func (DeviceProfileClientMock) Delete ¶
func (DeviceProfileClientMock) Delete(id string, ctx context.Context) error
func (DeviceProfileClientMock) DeleteByName ¶
func (DeviceProfileClientMock) DeleteByName(name string, ctx context.Context) error
func (DeviceProfileClientMock) DeviceProfile ¶
func (DeviceProfileClientMock) DeviceProfile(id string, ctx context.Context) (contract.DeviceProfile, error)
func (DeviceProfileClientMock) DeviceProfileForName ¶
func (DeviceProfileClientMock) DeviceProfileForName(name string, ctx context.Context) (contract.DeviceProfile, error)
func (DeviceProfileClientMock) DeviceProfiles ¶
func (DeviceProfileClientMock) DeviceProfiles(ctx context.Context) ([]contract.DeviceProfile, error)
func (DeviceProfileClientMock) Update ¶
func (DeviceProfileClientMock) Update(dp contract.DeviceProfile, ctx context.Context) error
func (DeviceProfileClientMock) UploadFile ¶
type DriverMock ¶
type DriverMock struct{}
func (DriverMock) AddDevice ¶ added in v1.1.0
func (DriverMock) AddDevice(deviceName string, protocols map[string]contract.ProtocolProperties, adminState contract.AdminState) error
func (DriverMock) DisconnectDevice ¶
func (DriverMock) DisconnectDevice(deviceName string, protocols map[string]contract.ProtocolProperties) error
func (DriverMock) HandleReadCommands ¶
func (DriverMock) HandleReadCommands(deviceName string, protocols map[string]contract.ProtocolProperties, reqs []dsModels.CommandRequest) (res []*dsModels.CommandValue, err error)
func (DriverMock) HandleWriteCommands ¶
func (DriverMock) HandleWriteCommands(deviceName string, protocols map[string]contract.ProtocolProperties, reqs []dsModels.CommandRequest, params []*dsModels.CommandValue) error
func (DriverMock) Initialize ¶
func (DriverMock) Initialize(lc logger.LoggingClient, asyncCh chan<- *dsModels.AsyncValues) error
func (DriverMock) RemoveDevice ¶ added in v1.1.0
func (DriverMock) RemoveDevice(deviceName string, protocols map[string]contract.ProtocolProperties) error
func (DriverMock) Stop ¶
func (DriverMock) Stop(force bool) error
func (DriverMock) UpdateDevice ¶ added in v1.1.0
func (DriverMock) UpdateDevice(deviceName string, protocols map[string]contract.ProtocolProperties, adminState contract.AdminState) error
type EventClientMock ¶
type EventClientMock struct{}
func (EventClientMock) DeleteForDevice ¶
func (EventClientMock) DeleteForDevice(id string, ctx context.Context) error
func (EventClientMock) DeleteOld ¶
func (EventClientMock) DeleteOld(age int, ctx context.Context) error
func (EventClientMock) EventCount ¶
func (EventClientMock) EventCount(ctx context.Context) (int, error)
func (EventClientMock) EventCountForDevice ¶
func (EventClientMock) EventsForDevice ¶
func (EventClientMock) EventsForDeviceAndValueDescriptor ¶
func (EventClientMock) EventsForInterval ¶
func (EventClientMock) MarkPushed ¶
func (EventClientMock) MarkPushed(id string, ctx context.Context) error
func (EventClientMock) MarkPushedByChecksum ¶
func (EventClientMock) MarkPushedByChecksum(id string, ctx context.Context) error
func (EventClientMock) MarshalEvent ¶
func (EventClientMock) MarshalEvent(e contract.Event) ([]byte, error)
type ProvisionWatcherClientMock ¶ added in v1.2.0
type ProvisionWatcherClientMock struct { }
func (ProvisionWatcherClientMock) Add ¶ added in v1.2.0
func (ProvisionWatcherClientMock) Add(dev *contract.ProvisionWatcher, ctx context.Context) (string, error)
Add a provision watcher - handle error codes
func (ProvisionWatcherClientMock) Delete ¶ added in v1.2.0
func (ProvisionWatcherClientMock) Delete(id string, ctx context.Context) error
Delete a provision watcher (specified by id)
func (ProvisionWatcherClientMock) ProvisionWatcher ¶ added in v1.2.0
func (ProvisionWatcherClientMock) ProvisionWatcher(id string, ctx context.Context) (contract.ProvisionWatcher, error)
Get the provision watcher by id
func (ProvisionWatcherClientMock) ProvisionWatcherForName ¶ added in v1.2.0
func (ProvisionWatcherClientMock) ProvisionWatcherForName(name string, ctx context.Context) (contract.ProvisionWatcher, error)
Get the provision watcher by name
func (ProvisionWatcherClientMock) ProvisionWatchers ¶ added in v1.2.0
func (ProvisionWatcherClientMock) ProvisionWatchers(ctx context.Context) ([]contract.ProvisionWatcher, error)
Get a list of all provision watchers
func (ProvisionWatcherClientMock) ProvisionWatchersForProfile ¶ added in v1.2.0
func (ProvisionWatcherClientMock) ProvisionWatchersForProfile(profileId string, ctx context.Context) ([]contract.ProvisionWatcher, error)
Get the provision watchers for a profile
func (ProvisionWatcherClientMock) ProvisionWatchersForProfileByName ¶ added in v1.2.0
func (ProvisionWatcherClientMock) ProvisionWatchersForProfileByName(profileName string, ctx context.Context) ([]contract.ProvisionWatcher, error)
Get the provision watchers for a profile (by name)
func (ProvisionWatcherClientMock) ProvisionWatchersForService ¶ added in v1.2.0
func (ProvisionWatcherClientMock) ProvisionWatchersForService(serviceId string, ctx context.Context) ([]contract.ProvisionWatcher, error)
Get the provision watchers that are on a service
func (ProvisionWatcherClientMock) ProvisionWatchersForServiceByName ¶ added in v1.2.0
func (ProvisionWatcherClientMock) ProvisionWatchersForServiceByName(serviceName string, ctx context.Context) ([]contract.ProvisionWatcher, error)
Get the provision watchers that are on a service(by name)
func (ProvisionWatcherClientMock) Update ¶ added in v1.2.0
func (ProvisionWatcherClientMock) Update(dev contract.ProvisionWatcher, ctx context.Context) error
Update a provision watcher - handle error codes
type ValueDescriptorMock ¶
type ValueDescriptorMock struct{}
func (ValueDescriptorMock) Add ¶
func (ValueDescriptorMock) Add(vdr *contract.ValueDescriptor, ctx context.Context) (string, error)
func (ValueDescriptorMock) Delete ¶
func (ValueDescriptorMock) Delete(id string, ctx context.Context) error
func (ValueDescriptorMock) DeleteByName ¶
func (ValueDescriptorMock) DeleteByName(name string, ctx context.Context) error
func (ValueDescriptorMock) Update ¶
func (ValueDescriptorMock) Update(vdr *contract.ValueDescriptor, ctx context.Context) error
func (ValueDescriptorMock) ValueDescriptor ¶
func (ValueDescriptorMock) ValueDescriptor(id string, ctx context.Context) (contract.ValueDescriptor, error)
func (ValueDescriptorMock) ValueDescriptorForName ¶
func (ValueDescriptorMock) ValueDescriptorForName(name string, ctx context.Context) (contract.ValueDescriptor, error)
func (ValueDescriptorMock) ValueDescriptors ¶
func (ValueDescriptorMock) ValueDescriptors(ctx context.Context) ([]contract.ValueDescriptor, error)
func (ValueDescriptorMock) ValueDescriptorsByLabel ¶
func (ValueDescriptorMock) ValueDescriptorsByLabel(label string, ctx context.Context) ([]contract.ValueDescriptor, error)
func (ValueDescriptorMock) ValueDescriptorsByUomLabel ¶
func (ValueDescriptorMock) ValueDescriptorsByUomLabel(uomLabel string, ctx context.Context) ([]contract.ValueDescriptor, error)
func (ValueDescriptorMock) ValueDescriptorsForDevice ¶
func (ValueDescriptorMock) ValueDescriptorsForDevice(deviceId string, ctx context.Context) ([]contract.ValueDescriptor, error)
func (ValueDescriptorMock) ValueDescriptorsForDeviceByName ¶
func (ValueDescriptorMock) ValueDescriptorsForDeviceByName(deviceName string, ctx context.Context) ([]contract.ValueDescriptor, error)
func (ValueDescriptorMock) ValueDescriptorsUsage ¶ added in v1.1.0
Click to show internal directories.
Click to hide internal directories.