mock

package
v1.2.0-dev.12 Latest Latest
Warning

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

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

Documentation

Index

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) Addressable

func (AddressableClientMock) AddressableForName

func (AddressableClientMock) AddressableForName(name string, ctx context.Context) (contract.Addressable, error)

func (AddressableClientMock) Delete

func (AddressableClientMock) Update

type DeviceClientMock

type DeviceClientMock struct{}

func (*DeviceClientMock) Add

func (dc *DeviceClientMock) Add(dev *contract.Device, ctx context.Context) (string, error)

func (*DeviceClientMock) CheckForDevice

func (dc *DeviceClientMock) CheckForDevice(token string, ctx context.Context) (contract.Device, error)

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) Device

func (dc *DeviceClientMock) Device(id string, ctx context.Context) (contract.Device, error)

func (*DeviceClientMock) DeviceForName

func (dc *DeviceClientMock) DeviceForName(name string, ctx context.Context) (contract.Device, error)

func (*DeviceClientMock) Devices

func (dc *DeviceClientMock) Devices(ctx context.Context) ([]contract.Device, error)

func (*DeviceClientMock) DevicesByLabel

func (dc *DeviceClientMock) DevicesByLabel(label string, ctx context.Context) ([]contract.Device, error)

func (*DeviceClientMock) DevicesForProfile

func (dc *DeviceClientMock) DevicesForProfile(profileid string, ctx context.Context) ([]contract.Device, error)

func (*DeviceClientMock) DevicesForProfileByName

func (dc *DeviceClientMock) DevicesForProfileByName(profileName string, ctx context.Context) ([]contract.Device, error)

func (*DeviceClientMock) DevicesForService

func (dc *DeviceClientMock) DevicesForService(serviceid string, ctx context.Context) ([]contract.Device, error)

func (*DeviceClientMock) DevicesForServiceByName

func (dc *DeviceClientMock) DevicesForServiceByName(serviceName string, ctx context.Context) ([]contract.Device, error)

func (*DeviceClientMock) Update

func (dc *DeviceClientMock) Update(dev contract.Device, ctx context.Context) error

func (*DeviceClientMock) UpdateAdminState

func (dc *DeviceClientMock) UpdateAdminState(id string, adminState string, ctx context.Context) error

func (*DeviceClientMock) UpdateAdminStateByName

func (dc *DeviceClientMock) UpdateAdminStateByName(name string, adminState string, ctx context.Context) error

func (*DeviceClientMock) UpdateLastConnected

func (dc *DeviceClientMock) UpdateLastConnected(id string, time int64, ctx context.Context) error

func (*DeviceClientMock) UpdateLastConnectedByName

func (dc *DeviceClientMock) UpdateLastConnectedByName(name string, time int64, ctx context.Context) error

func (*DeviceClientMock) UpdateLastReported

func (dc *DeviceClientMock) UpdateLastReported(id string, time int64, ctx context.Context) error

func (*DeviceClientMock) UpdateLastReportedByName

func (dc *DeviceClientMock) UpdateLastReportedByName(name string, time int64, ctx context.Context) error

func (*DeviceClientMock) UpdateOpState

func (dc *DeviceClientMock) UpdateOpState(id string, opState string, ctx context.Context) error

func (*DeviceClientMock) UpdateOpStateByName

func (dc *DeviceClientMock) UpdateOpStateByName(name string, opState string, ctx context.Context) error

type DeviceProfileClientMock

type DeviceProfileClientMock struct{}

func (DeviceProfileClientMock) Add

func (DeviceProfileClientMock) Delete

func (DeviceProfileClientMock) DeleteByName

func (DeviceProfileClientMock) DeleteByName(name string, ctx context.Context) error

func (DeviceProfileClientMock) DeviceProfile

func (DeviceProfileClientMock) DeviceProfileForName

func (DeviceProfileClientMock) DeviceProfileForName(name string, ctx context.Context) (contract.DeviceProfile, error)

func (DeviceProfileClientMock) DeviceProfiles

func (DeviceProfileClientMock) Update

func (DeviceProfileClientMock) Upload

func (DeviceProfileClientMock) Upload(yamlString string, ctx context.Context) (string, error)

func (DeviceProfileClientMock) UploadFile

func (DeviceProfileClientMock) UploadFile(yamlFilePath string, ctx context.Context) (string, error)

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) Add

func (EventClientMock) AddBytes

func (EventClientMock) AddBytes(event []byte, ctx context.Context) (string, error)

func (EventClientMock) Delete

func (EventClientMock) Delete(id string, ctx context.Context) error

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) Event

func (EventClientMock) EventCount

func (EventClientMock) EventCount(ctx context.Context) (int, error)

func (EventClientMock) EventCountForDevice

func (EventClientMock) EventCountForDevice(deviceId string, ctx context.Context) (int, error)

func (EventClientMock) Events

func (EventClientMock) EventsForDevice

func (EventClientMock) EventsForDevice(id string, limit int, ctx context.Context) ([]contract.Event, error)

func (EventClientMock) EventsForDeviceAndValueDescriptor

func (EventClientMock) EventsForDeviceAndValueDescriptor(deviceId string, vd string, limit int, ctx context.Context) ([]contract.Event, error)

func (EventClientMock) EventsForInterval

func (EventClientMock) EventsForInterval(start int, end int, limit int, ctx context.Context) ([]contract.Event, error)

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

Add a provision watcher - handle error codes

func (ProvisionWatcherClientMock) Delete added in v1.2.0

Delete a provision watcher (specified by id)

func (ProvisionWatcherClientMock) ProvisionWatcher added in v1.2.0

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

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

Update a provision watcher - handle error codes

type ValueDescriptorMock

type ValueDescriptorMock struct{}

func (ValueDescriptorMock) Add

func (ValueDescriptorMock) Delete

func (ValueDescriptorMock) DeleteByName

func (ValueDescriptorMock) DeleteByName(name string, ctx context.Context) error

func (ValueDescriptorMock) Update

func (ValueDescriptorMock) ValueDescriptor

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

func (ValueDescriptorMock) ValueDescriptorsUsage(names []string, ctx context.Context) (map[string]bool, error)

Jump to

Keyboard shortcuts

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