mock

package
v2.0.0-dev.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 18 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"
	ResourceObjectNaNFloat32  = "NaN_Float32"
	ResourceObjectNaNFloat64  = "NaN_Float64"
)
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{}
	NewValueDescriptor                 = contract.ValueDescriptor{}
	DuplicateValueDescriptorInt16      = contract.ValueDescriptor{}
)

Functions

func CreateDescriptorsFromProfile

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 (*DeviceClientMock) CheckForDevice

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

func (*DeviceClientMock) Delete

func (dc *DeviceClientMock) Delete(_ context.Context, _ string) error

func (*DeviceClientMock) DeleteByName

func (dc *DeviceClientMock) DeleteByName(_ context.Context, _ string) error

func (*DeviceClientMock) Device

func (*DeviceClientMock) DeviceForName

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

func (*DeviceClientMock) Devices

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

func (*DeviceClientMock) DevicesByLabel

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

func (*DeviceClientMock) DevicesForProfile

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

func (*DeviceClientMock) DevicesForProfileByName

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

func (*DeviceClientMock) DevicesForService

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

func (*DeviceClientMock) DevicesForServiceByName

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

func (*DeviceClientMock) Update

func (*DeviceClientMock) UpdateAdminState

func (dc *DeviceClientMock) UpdateAdminState(_ context.Context, _ string, _ admin.UpdateRequest) error

func (*DeviceClientMock) UpdateAdminStateByName

func (dc *DeviceClientMock) UpdateAdminStateByName(_ context.Context, _ string, _ admin.UpdateRequest) error

func (*DeviceClientMock) UpdateLastConnected

func (dc *DeviceClientMock) UpdateLastConnected(_ context.Context, _ string, _ int64) error

func (*DeviceClientMock) UpdateLastConnectedByName

func (dc *DeviceClientMock) UpdateLastConnectedByName(_ context.Context, _ string, _ int64) error

func (*DeviceClientMock) UpdateLastReported

func (dc *DeviceClientMock) UpdateLastReported(_ context.Context, _ string, _ int64) error

func (*DeviceClientMock) UpdateLastReportedByName

func (dc *DeviceClientMock) UpdateLastReportedByName(_ context.Context, _ string, _ int64) error

func (*DeviceClientMock) UpdateOpState

func (dc *DeviceClientMock) UpdateOpState(_ context.Context, _ string, _ operating.UpdateRequest) error

func (*DeviceClientMock) UpdateOpStateByName

func (dc *DeviceClientMock) UpdateOpStateByName(_ context.Context, _ string, _ operating.UpdateRequest) error

type DeviceProfileClientMock

type DeviceProfileClientMock struct{}

func (DeviceProfileClientMock) Add

func (DeviceProfileClientMock) Delete

func (DeviceProfileClientMock) DeleteByName

func (DeviceProfileClientMock) DeleteByName(_ context.Context, _ string) error

func (DeviceProfileClientMock) DeviceProfile

func (DeviceProfileClientMock) DeviceProfileForName

func (DeviceProfileClientMock) DeviceProfiles

func (DeviceProfileClientMock) Update

func (DeviceProfileClientMock) Upload

func (DeviceProfileClientMock) UploadFile

type DriverMock

type DriverMock struct{}

func (DriverMock) AddDevice

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, deviceCh chan<- []dsModels.DiscoveredDevice) error

func (DriverMock) RemoveDevice

func (DriverMock) RemoveDevice(deviceName string, protocols map[string]contract.ProtocolProperties) error

func (DriverMock) Stop

func (DriverMock) Stop(force bool) error

func (DriverMock) UpdateDevice

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 (e EventClientMock) AddBytes(_ context.Context, _ []byte) (string, error)

func (EventClientMock) Delete

func (e EventClientMock) Delete(_ context.Context, _ string) error

func (EventClientMock) DeleteForDevice

func (e EventClientMock) DeleteForDevice(_ context.Context, _ string) error

func (EventClientMock) DeleteOld

func (e EventClientMock) DeleteOld(_ context.Context, _ int) error

func (EventClientMock) Event

func (EventClientMock) EventCount

func (e EventClientMock) EventCount(_ context.Context) (int, error)

func (EventClientMock) EventCountForDevice

func (e EventClientMock) EventCountForDevice(_ context.Context, _ string) (int, error)

func (EventClientMock) Events

func (EventClientMock) EventsForDevice

func (e EventClientMock) EventsForDevice(_ context.Context, _ string, _ int) ([]contract.Event, error)

func (EventClientMock) EventsForDeviceAndValueDescriptor

func (e EventClientMock) EventsForDeviceAndValueDescriptor(_ context.Context, _ string, _ string, _ int) ([]contract.Event, error)

func (EventClientMock) EventsForInterval

func (e EventClientMock) EventsForInterval(_ context.Context, _ int, _ int, _ int) ([]contract.Event, error)

func (EventClientMock) MarkPushed

func (e EventClientMock) MarkPushed(_ context.Context, _ string) error

func (EventClientMock) MarkPushedByChecksum

func (e EventClientMock) MarkPushedByChecksum(_ context.Context, _ string) error

func (EventClientMock) MarshalEvent

func (e EventClientMock) MarshalEvent(_ contract.Event) ([]byte, error)

type ProvisionWatcherClientMock

type ProvisionWatcherClientMock struct {
}

func (ProvisionWatcherClientMock) Add

Add a provision watcher - handle error codes

func (ProvisionWatcherClientMock) Delete

Delete a provision watcher (specified by id)

func (ProvisionWatcherClientMock) ProvisionWatcher

Get the provision watcher by id

func (ProvisionWatcherClientMock) ProvisionWatcherForName

Get the provision watcher by name

func (ProvisionWatcherClientMock) ProvisionWatchers

Get a list of all provision watchers

func (ProvisionWatcherClientMock) ProvisionWatchersForProfile

func (ProvisionWatcherClientMock) ProvisionWatchersForProfile(_ context.Context, _ string) ([]contract.ProvisionWatcher, error)

Get the provision watchers for a profile

func (ProvisionWatcherClientMock) ProvisionWatchersForProfileByName

func (ProvisionWatcherClientMock) ProvisionWatchersForProfileByName(_ context.Context, _ string) ([]contract.ProvisionWatcher, error)

Get the provision watchers for a profile (by name)

func (ProvisionWatcherClientMock) ProvisionWatchersForService

func (ProvisionWatcherClientMock) ProvisionWatchersForService(_ context.Context, _ string) ([]contract.ProvisionWatcher, error)

Get the provision watchers that are on a service

func (ProvisionWatcherClientMock) ProvisionWatchersForServiceByName

func (ProvisionWatcherClientMock) ProvisionWatchersForServiceByName(_ context.Context, _ string) ([]contract.ProvisionWatcher, error)

Get the provision watchers that are on a service(by name)

func (ProvisionWatcherClientMock) Update

Update a provision watcher - handle error codes

type ValueDescriptorMock

type ValueDescriptorMock struct{}

func (ValueDescriptorMock) Add

func (ValueDescriptorMock) Delete

func (ValueDescriptorMock) DeleteByName

func (ValueDescriptorMock) DeleteByName(_ context.Context, _ string) error

func (ValueDescriptorMock) Update

func (ValueDescriptorMock) ValueDescriptor

func (ValueDescriptorMock) ValueDescriptorForName

func (ValueDescriptorMock) ValueDescriptorForName(_ context.Context, _ string) (contract.ValueDescriptor, error)

func (ValueDescriptorMock) ValueDescriptors

func (ValueDescriptorMock) ValueDescriptorsByLabel

func (ValueDescriptorMock) ValueDescriptorsByLabel(_ context.Context, _ string) ([]contract.ValueDescriptor, error)

func (ValueDescriptorMock) ValueDescriptorsByUomLabel

func (ValueDescriptorMock) ValueDescriptorsByUomLabel(_ context.Context, _ string) ([]contract.ValueDescriptor, error)

func (ValueDescriptorMock) ValueDescriptorsForDevice

func (ValueDescriptorMock) ValueDescriptorsForDevice(_ context.Context, _ string) ([]contract.ValueDescriptor, error)

func (ValueDescriptorMock) ValueDescriptorsForDeviceByName

func (ValueDescriptorMock) ValueDescriptorsForDeviceByName(_ context.Context, _ string) ([]contract.ValueDescriptor, error)

func (ValueDescriptorMock) ValueDescriptorsUsage

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

Jump to

Keyboard shortcuts

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