types

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: MIT Imports: 10 Imported by: 38

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DateTimeToString added in v0.7.1

func DateTimeToString(d *DateTime) string

Types

type Card

type Card struct {
	CardNumber uint32        `json:"card-number"`
	From       *Date         `json:"start-date"`
	To         *Date         `json:"end-date"`
	Doors      map[uint8]int `json:"doors"`
}

func (*Card) Clone

func (c *Card) Clone() Card

func (Card) String

func (c Card) String() string

func (*Card) UnmarshalJSON

func (c *Card) UnmarshalJSON(bytes []byte) error

type Date

type Date time.Time

func DateFromString

func DateFromString(s string) (*Date, error)

func ToDate added in v0.7.0

func ToDate(year int, month time.Month, day int) Date

func (Date) After

func (d Date) After(date Date) bool

func (Date) Before

func (d Date) Before(date Date) bool

func (Date) MarshalJSON

func (d Date) MarshalJSON() ([]byte, error)

func (Date) MarshalUT0311L0x

func (d Date) MarshalUT0311L0x() ([]byte, error)

func (Date) String

func (d Date) String() string

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(bytes []byte) error

func (*Date) UnmarshalUT0311L0x

func (d *Date) UnmarshalUT0311L0x(bytes []byte) (interface{}, error)

func (Date) Weekday added in v0.7.0

func (d Date) Weekday() time.Weekday

type DateTime

type DateTime time.Time

func DateTimeFromString

func DateTimeFromString(s string) (*DateTime, error)

func (DateTime) MarshalJSON

func (d DateTime) MarshalJSON() ([]byte, error)

func (DateTime) MarshalText added in v0.7.1

func (d DateTime) MarshalText() ([]byte, error)

func (DateTime) MarshalUT0311L0x

func (d DateTime) MarshalUT0311L0x() ([]byte, error)

func (DateTime) String

func (d DateTime) String() string

func (*DateTime) UnmarshalJSON

func (d *DateTime) UnmarshalJSON(bytes []byte) error

func (*DateTime) UnmarshalUT0311L0x

func (d *DateTime) UnmarshalUT0311L0x(bytes []byte) (interface{}, error)

type Device

type Device struct {
	Name         string
	SerialNumber SerialNumber
	IpAddress    net.IP
	SubnetMask   net.IP
	Gateway      net.IP
	MacAddress   MacAddress
	Version      Version
	Date         Date
	Address      net.UDPAddr
	TimeZone     *time.Location
}

func (*Device) String

func (device *Device) String() string

type DoorControl added in v0.7.1

type DoorControl int
const (
	Controlled DoorControl = iota
	Open
	Closed
	FirstCardOnly
)

func (DoorControl) String added in v0.7.1

func (d DoorControl) String() string

type DoorControlState

type DoorControlState struct {
	SerialNumber SerialNumber
	Door         uint8
	ControlState uint8
	Delay        uint8
}

func (*DoorControlState) String

func (d *DoorControlState) String() string

type Event

type Event struct {
	SerialNumber SerialNumber
	Index        uint32
	Type         byte
	Granted      bool
	Door         byte
	Direction    uint8
	CardNumber   uint32
	Timestamp    DateTime
	Reason       uint8
}

func (*Event) String

func (s *Event) String() string

type EventIndex

type EventIndex struct {
	SerialNumber SerialNumber
	Index        uint32
}

func (*EventIndex) String

func (s *EventIndex) String() string

type EventIndexResult

type EventIndexResult struct {
	SerialNumber SerialNumber
	Index        uint32
	Changed      bool
}

func (*EventIndexResult) String

func (s *EventIndexResult) String() string

type FirstCard added in v0.7.1

type FirstCard struct {
	Door      uint8       `json:"door,omitempty"`
	Start     HHmm        `json:"start,omitempty"`
	StartMode DoorControl `json:"start-mode"`
	End       HHmm        `json:"end,omitempty"`
	EndMode   DoorControl `json:"end-mode"`
	Weekdays  Weekdays    `json:"weekdays,omitempty"`
}

func (FirstCard) String added in v0.7.1

func (f FirstCard) String() string

func (*FirstCard) UnmarshalJSON added in v0.7.1

func (f *FirstCard) UnmarshalJSON(bytes []byte) error

type HHmm added in v0.7.0

type HHmm struct {
	// contains filtered or unexported fields
}

func HHmmFromString added in v0.7.0

func HHmmFromString(s string) (*HHmm, error)

func HHmmFromTime added in v0.7.0

func HHmmFromTime(t time.Time) HHmm

func NewHHmm added in v0.7.0

func NewHHmm(hours, minutes int) HHmm

func (HHmm) After added in v0.7.0

func (h HHmm) After(t HHmm) bool

func (HHmm) Before added in v0.7.0

func (h HHmm) Before(t HHmm) bool

func (HHmm) Equals added in v0.7.1

func (h HHmm) Equals(t HHmm) bool

func (HHmm) MarshalJSON added in v0.7.0

func (h HHmm) MarshalJSON() ([]byte, error)

func (HHmm) MarshalUT0311L0x added in v0.7.0

func (h HHmm) MarshalUT0311L0x() ([]byte, error)

func (HHmm) String added in v0.7.0

func (h HHmm) String() string

func (*HHmm) UnmarshalJSON added in v0.7.0

func (h *HHmm) UnmarshalJSON(bytes []byte) error

func (*HHmm) UnmarshalUT0311L0x added in v0.7.0

func (h *HHmm) UnmarshalUT0311L0x(bytes []byte) (interface{}, error)

type Listener

type Listener struct {
	SerialNumber SerialNumber
	Address      net.UDPAddr
}

func (*Listener) String

func (l *Listener) String() string

type MacAddress

type MacAddress net.HardwareAddr

func (MacAddress) MarshalJSON

func (m MacAddress) MarshalJSON() ([]byte, error)

func (MacAddress) MarshalUT0311L0x

func (m MacAddress) MarshalUT0311L0x() ([]byte, error)

func (MacAddress) String

func (m MacAddress) String() string

func (*MacAddress) UnmarshalJSON

func (m *MacAddress) UnmarshalJSON(bytes []byte) error

func (*MacAddress) UnmarshalUT0311L0x

func (m *MacAddress) UnmarshalUT0311L0x(bytes []byte) (interface{}, error)

type MsgType

type MsgType uint8

type Result

type Result struct {
	SerialNumber SerialNumber
	Succeeded    bool
}

func (*Result) String

func (r *Result) String() string

type SOM added in v0.6.8

type SOM uint8

type Segment added in v0.7.0

type Segment struct {
	Start HHmm `json:"start,omitempty"`
	End   HHmm `json:"end,omitempty"`
}

func (Segment) String added in v0.7.0

func (s Segment) String() string

type Segments added in v0.7.0

type Segments map[uint8]Segment

func (Segments) MarshalJSON added in v0.7.0

func (ss Segments) MarshalJSON() ([]byte, error)

func (Segments) String added in v0.7.0

func (ss Segments) String() string

func (*Segments) UnmarshalJSON added in v0.7.0

func (ss *Segments) UnmarshalJSON(bytes []byte) error

type SerialNumber

type SerialNumber uint32

func (SerialNumber) MarshalUT0311L0x

func (s SerialNumber) MarshalUT0311L0x() ([]byte, error)

func (SerialNumber) String

func (s SerialNumber) String() string

func (*SerialNumber) UnmarshalUT0311L0x

func (s *SerialNumber) UnmarshalUT0311L0x(bytes []byte) (interface{}, error)

type Status

type Status struct {
	SerialNumber   SerialNumber
	DoorState      map[uint8]bool
	DoorButton     map[uint8]bool
	SystemError    uint8
	SystemDateTime DateTime
	SequenceId     uint32
	SpecialInfo    uint8
	RelayState     uint8
	InputState     uint8
	Event          *StatusEvent
}

func (*Status) String

func (s *Status) String() string

type StatusEvent added in v0.6.12

type StatusEvent struct {
	Index      uint32
	Type       byte
	Granted    bool
	Door       byte
	Direction  uint8
	CardNumber uint32
	Timestamp  *DateTime
	Reason     uint8
}

type SystemDate

type SystemDate time.Time

func (SystemDate) MarshalUT0311L0x

func (d SystemDate) MarshalUT0311L0x() ([]byte, error)

func (SystemDate) String

func (d SystemDate) String() string

func (*SystemDate) UnmarshalUT0311L0x

func (d *SystemDate) UnmarshalUT0311L0x(bytes []byte) (interface{}, error)

type SystemTime

type SystemTime time.Time

func TimeFromString added in v0.7.0

func TimeFromString(s string) (*SystemTime, error)

func (SystemTime) MarshalUT0311L0x

func (d SystemTime) MarshalUT0311L0x() ([]byte, error)

func (SystemTime) String

func (t SystemTime) String() string

func (*SystemTime) UnmarshalUT0311L0x

func (t *SystemTime) UnmarshalUT0311L0x(bytes []byte) (interface{}, error)

type Task added in v0.7.1

type Task struct {
	Task     TaskType `json:"task"`
	Door     uint8    `json:"door,omitempty"`
	From     Date     `json:"start-date,omitempty"`
	To       Date     `json:"end-date,omitempty"`
	Weekdays Weekdays `json:"weekdays,omitempty"`
	Start    HHmm     `json:"start,omitempty"`
	Cards    uint8    `json:"cards,omitempty"`
}

func (Task) String added in v0.7.1

func (t Task) String() string

func (*Task) UnmarshalJSON added in v0.7.1

func (t *Task) UnmarshalJSON(bytes []byte) error

type TaskType added in v0.7.1

type TaskType int
const (
	DoorControlled TaskType = iota
	DoorNormallyOpen
	DoorNormallyClosed
	DisableTimeProfile
	EnableTimeProfile
	CardNoPassword
	CardInPassword
	CardInOutPassword
	EnableMoreCards
	DisableMoreCards
	TriggerOnce
	DisablePushButton
	EnablePushButton
)

func (TaskType) MarshalJSON added in v0.7.1

func (tt TaskType) MarshalJSON() ([]byte, error)

func (TaskType) String added in v0.7.1

func (tt TaskType) String() string

func (*TaskType) UnmarshalJSON added in v0.7.1

func (tt *TaskType) UnmarshalJSON(b []byte) error

func (*TaskType) UnmarshalTSV added in v0.7.1

func (tt *TaskType) UnmarshalTSV(s string) (interface{}, error)

type Time

type Time struct {
	SerialNumber SerialNumber
	DateTime     DateTime
}

func (Time) String

func (t Time) String() string

type TimeProfile added in v0.7.0

type TimeProfile struct {
	ID              uint8    `json:"id"`
	LinkedProfileID uint8    `json:"linked-profile,omitempty"`
	From            *Date    `json:"start-date,omitempty"`
	To              *Date    `json:"end-date,omitempty"`
	Weekdays        Weekdays `json:"weekdays,omitempty"`
	Segments        Segments `json:"segments,omitempty"`
}

func (TimeProfile) String added in v0.7.0

func (t TimeProfile) String() string

func (*TimeProfile) UnmarshalJSON added in v0.7.0

func (t *TimeProfile) UnmarshalJSON(bytes []byte) error

type Version

type Version uint16

func (Version) MarshalJSON

func (v Version) MarshalJSON() ([]byte, error)

func (Version) MarshalUT0311L0x

func (v Version) MarshalUT0311L0x() ([]byte, error)

func (Version) String added in v0.6.8

func (v Version) String() string

func (*Version) UnmarshalJSON

func (v *Version) UnmarshalJSON(bytes []byte) error

func (*Version) UnmarshalUT0311L0x

func (v *Version) UnmarshalUT0311L0x(bytes []byte) (interface{}, error)

type Weekdays added in v0.7.0

type Weekdays map[time.Weekday]bool

func (Weekdays) MarshalJSON added in v0.7.0

func (w Weekdays) MarshalJSON() ([]byte, error)

func (Weekdays) String added in v0.7.0

func (w Weekdays) String() string

func (*Weekdays) UnmarshalJSON added in v0.7.0

func (w *Weekdays) UnmarshalJSON(bytes []byte) error

Jump to

Keyboard shortcuts

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