Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EventHandler ¶
func EventHandler(h func(sw.Switcher, sw.Device)) func(*DummySwitch)
EventHandler sets a callback function through which the bandswitch will report Events
func Switch ¶
func Switch(sc SwitchConfig) func(*DummySwitch)
Switch is a functional option to set the switch's configuration.
Types ¶
type DummySwitch ¶
func NewDummySwitch ¶
func NewDummySwitch(options ...func(*DummySwitch)) *DummySwitch
func (*DummySwitch) GetPort ¶
func (d *DummySwitch) GetPort(portName string) (sw.Port, error)
GetPort returns switch.Port struct containing the current state of the requested port.
func (*DummySwitch) Init ¶
func (d *DummySwitch) Init() error
func (*DummySwitch) Name ¶
func (d *DummySwitch) Name() string
Name returns the Name of this Dummy Switch
func (*DummySwitch) Serialize ¶
func (d *DummySwitch) Serialize() sw.Device
Serialize returns a switch.Device struct containing the current state and configuration of this Dummy switch.
type PortConfig ¶
PortConfig describes a port which is a collection of gpio pins. This struct is injected through the functional option "Port" during construction of BandswitchGPIO.
type SwitchConfig ¶
type SwitchConfig struct { Name string Index int Exclusive bool Ports []PortConfig }
SwitchConfig describes a switch which is a collection of ports.
Click to show internal directories.
Click to hide internal directories.