mock

package
v0.0.0-test-multiarch Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: GPL-3.0 Imports: 36 Imported by: 0

README

Mock Device Driver

This driver allows you to configure in-memory mock devices that implement specific traits, useful for testing.

The driver config looks like this:

{
  "drivers": [
    {
      "type": "mock",
      "devices": [
        {"name": "MyDevice", "traits": [{"name": "smartcore.traits.Light"}]}
      ]
    }
  ]
}

The devices array in the config is modelled after the Metadata trait resource type, any metadata you want can be specified:

{"name": "MyDevice", "membership": {"subsystem": "Lighting"}, ...}

Caveats

Not all traits are implemented, see driver.go/newMockClient for the trait clients that are available.

Documentation

Index

Constants

View Source
const DriverName = "mock"

Variables

View Source
var Factory driver.Factory = factory{}

Functions

This section is empty.

Types

type Driver

type Driver struct {
	*service.Service[config.Root]
	// contains filtered or unexported fields
}

func NewDriver

func NewDriver(services driver.Services) *Driver

func (*Driver) Clean

func (d *Driver) Clean()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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