mock

package
v1.0.1-0...-a908c99 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	InvalidDeviceId                = "1ef435eb-5060-49b0-8d55-8d4e43239800"
	RandomIntegerGeneratorDeviceId = "79ef304e-3b1e-4765-b509-798109c2467d"
	RandomFloatGeneratorDeviceId   = "9a2b3ef2-6aed-41db-b868-79196c2a8b0a"
)
View Source
const Int8Value = int8(123)

Variables

View Source
var (
	ValidDeviceRandomBoolGenerator            = contract.Device{}
	ValidDeviceRandomIntegerGenerator         = contract.Device{}
	ValidDeviceRandomUnsignedIntegerGenerator = contract.Device{}
	ValidDeviceRandomFloatGenerator           = contract.Device{}
	DuplicateDeviceRandomFloatGenerator       = contract.Device{}
	NewValidDevice                            = 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 (
	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

This section is empty.

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

func (DriverMock) Stop(force bool) 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 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)

Jump to

Keyboard shortcuts

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