cobrafile

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Name    string
	Address string
	Port    uint16
	SN      uint16
	Doors   []string
}

type ControllerList

type ControllerList []Controller

func LoadController

func LoadController(filename string) (ControllerList, error)

func (ControllerList) FindDoor

func (l ControllerList) FindDoor(address string, door string) (uint8, bool)

FindDoor returns the 1-index door number.

func (ControllerList) LookupDoor

func (l ControllerList) LookupDoor(address string, door uint8) string

LookupDoor returns the 1-index door number.

func (ControllerList) LookupName

func (l ControllerList) LookupName(address string) string

LookupName returns the controller name.

If no controller is found, this returns the empty string.

func (ControllerList) LookupNameAndDoor

func (l ControllerList) LookupNameAndDoor(address string, door uint8) (string, string)

LookupNameAndDoor returns the controller name and the 1-index door number.

type Person

type Person struct {
	Number         int
	WorkerNumber   string
	Name           string
	CardID         string
	Department     string
	Attendance     bool
	AccessControl  bool
	OtherShift     bool
	DeactivateDate time.Time
}

type PersonnelList

type PersonnelList []Person

func LoadPersonnel

func LoadPersonnel(filename string) (PersonnelList, error)

func (PersonnelList) FindByCardID

func (l PersonnelList) FindByCardID(cardID string) *Person

Jump to

Keyboard shortcuts

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