testutil

package
v0.0.0-...-5a25428 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

README

Package github.com/cosnicolaou/automation/internal/testutil

import github.com/cosnicolaou/automation/internal/testutil

Types

Type ControllerDetail
type ControllerDetail struct {
	Detail string `yaml:"detail"`
	KeyID  string `yaml:"key_id"`
}
Type DeviceDetail
type DeviceDetail struct {
	Detail string `yaml:"detail"`
}
Type MockController
type MockController struct {
	devices.ControllerBase[ControllerDetail]
}
Methods
func (c *MockController) Disable(_ context.Context, opts devices.OperationArgs) error
func (c *MockController) Enable(_ context.Context, opts devices.OperationArgs) error
func (c *MockController) Implementation() any
func (c *MockController) Operations() map[string]devices.Operation
func (c *MockController) OperationsHelp() map[string]string
Type MockDevice
type MockDevice struct {
	devices.DeviceBase[DeviceDetail]
	// contains filtered or unexported fields
}
Functions
func NewMockDevice(operations ...string) *MockDevice
Methods
func (d *MockDevice) AddCondition(name string, outcome bool)
func (d *MockDevice) Conditions() map[string]devices.Condition
func (d *MockDevice) ConditionsHelp() map[string]string
func (d *MockDevice) ControlledBy() devices.Controller
func (d *MockDevice) Implementation() any
func (d *MockDevice) Operations() map[string]devices.Operation
func (d *MockDevice) OperationsHelp() map[string]string
func (d *MockDevice) SetController(c devices.Controller)
func (d *MockDevice) SetOutput(logger bool, writer bool)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerDetail

type ControllerDetail struct {
	Detail string `yaml:"detail"`
	KeyID  string `yaml:"key_id"`
}

type DeviceDetail

type DeviceDetail struct {
	Detail string `yaml:"detail"`
}

type MockController

type MockController struct {
	devices.ControllerBase[ControllerDetail]
}

func (*MockController) Disable

func (c *MockController) Disable(_ context.Context, opts devices.OperationArgs) (any, error)

func (*MockController) Enable

func (*MockController) Implementation

func (c *MockController) Implementation() any

func (*MockController) Operations

func (c *MockController) Operations() map[string]devices.Operation

func (*MockController) OperationsHelp

func (c *MockController) OperationsHelp() map[string]string

type MockDevice

type MockDevice struct {
	devices.DeviceBase[DeviceDetail]
	// contains filtered or unexported fields
}

func NewMockDevice

func NewMockDevice(operations ...string) *MockDevice

func (*MockDevice) AddCondition

func (d *MockDevice) AddCondition(name string, outcome bool)

func (*MockDevice) Conditions

func (d *MockDevice) Conditions() map[string]devices.Condition

func (*MockDevice) ConditionsHelp

func (d *MockDevice) ConditionsHelp() map[string]string

func (*MockDevice) ControlledBy

func (d *MockDevice) ControlledBy() devices.Controller

func (*MockDevice) Implementation

func (d *MockDevice) Implementation() any

func (*MockDevice) Operations

func (d *MockDevice) Operations() map[string]devices.Operation

func (*MockDevice) OperationsHelp

func (d *MockDevice) OperationsHelp() map[string]string

func (*MockDevice) SetController

func (d *MockDevice) SetController(c devices.Controller)

func (*MockDevice) SetOutput

func (d *MockDevice) SetOutput(writer bool)

Jump to

Keyboard shortcuts

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