simulator

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: MIT Imports: 5 Imported by: 0

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

func (l *DeviceList) Add(deviceID uint32, compressed bool, dir string) (bool, error)

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

func (*DeviceList) GetMessage

func (l *DeviceList) GetMessage() entities.Message

type Simulator

type Simulator interface {
	DeviceID() uint32
	DeviceType() string
	FilePath() string
	SetTxQ(chan entities.Message)

	Handle(*net.UDPAddr, messages.Request)
	RunTasks()
	Save() error
	Delete() error

	Swipe(cardNumber uint32, door uint8) (bool, error)
	Open(door uint8, duration *time.Duration) (bool, error)
	Close(door uint8) (bool, error)
	ButtonPressed(door uint8, duration time.Duration) (bool, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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