Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
BindAddress string
DeviceList DeviceList
Directory string
RestAddress string
}
type DeviceList ¶
type DeviceList struct {
// contains filtered or unexported fields
}
func NewDeviceList ¶
func NewDeviceList(l []Simulator) DeviceList
func (*DeviceList) Apply ¶
func (l *DeviceList) Apply(f func(Simulator))
func (*DeviceList) Delete ¶
func (l *DeviceList) Delete(deviceID uint32) error
func (*DeviceList) Find ¶
func (l *DeviceList) Find(deviceID uint32) Simulator
type Simulator ¶
type Simulator interface {
DeviceID() uint32
DeviceType() string
FilePath() string
Handle(messages.Request) (any, error)
Tick()
RunTasks()
Save() error
Delete() error
Swipe(cardNumber uint32, door uint8, direction entities.Direction, PIN uint32) (bool, error)
Passcode(door uint8, passcode uint32) (bool, error)
Open(door uint8) (bool, error)
Close(door uint8) (bool, error)
ButtonPressed(door uint8, duration time.Duration) (bool, error)
StoreCard(card uint32, from types.Date, to types.Date, doors []uint8, PIN uint32) error
}
Click to show internal directories.
Click to hide internal directories.