events

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const EventCard = schema.EventCard
View Source
const EventCardName = schema.EventCardName
View Source
const EventDeviceID = schema.EventDeviceID
View Source
const EventDeviceName = schema.EventDeviceName
View Source
const EventDirection = schema.EventDirection
View Source
const EventDoor = schema.EventDoor
View Source
const EventDoorName = schema.EventDoorName
View Source
const EventGranted = schema.EventGranted
View Source
const EventIndex = schema.EventIndex
View Source
const EventReason = schema.EventReason
View Source
const EventTimestamp = schema.EventTimestamp
View Source
const EventType = schema.EventType
View Source
const EventsFirst = schema.EventsFirst
View Source
const EventsLast = schema.EventsLast
View Source
const EventsOID = schema.EventsOID

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	catalog.CatalogEvent
	Timestamp  core.DateTime
	Type       eventType
	Door       uint8
	Direction  direction
	Card       uint32
	Granted    bool
	Reason     reason
	DeviceName string
	DoorName   string
	CardName   string
}

func NewEvent

func NewEvent(oid schema.OID, e uhppoted.Event, device, door, card string) Event

func (*Event) AsObjects

func (e *Event) AsObjects(a auth.OpAuth) []schema.Object

func (*Event) AsRuleEntity

func (e *Event) AsRuleEntity() (string, interface{})

func (Event) IsDeleted

func (e Event) IsDeleted() bool

func (Event) IsValid

func (e Event) IsValid() bool

type Events

type Events struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewEvents

func NewEvents() Events

func (*Events) AsObjects

func (ee *Events) AsObjects(start, max int, auth auth.OpAuth) []schema.Object

func (*Events) Clone

func (ee *Events) Clone() *Events

func (*Events) Load

func (ee *Events) Load(blob json.RawMessage) error

func (*Events) Missing

func (ee *Events) Missing(gaps int, controllers ...uint32) map[uint32][]types.Interval

NTS: for 1000000 events (i.e. in the expected range), binary search improves only slightly

on a sequential linear traverse but it's a cleaner algorithm and scales somewhat better.
Copying from the map is the dominant cost.

func (*Events) Print

func (ee *Events) Print()

func (*Events) Received

func (ee *Events) Received(deviceID uint32, recent []uhppoted.Event, lookup func(uhppoted.Event) (string, string, string))

func (*Events) Save

func (ee *Events) Save() (json.RawMessage, error)

func (*Events) UpdateByOID

func (ee *Events) UpdateByOID(auth auth.OpAuth, oid schema.OID, value string) ([]interface{}, error)

FIXME searches events list sequentially to find matching OID. But not ever actually invoked (as yet...)

func (*Events) Validate

func (ee *Events) Validate() error

Jump to

Keyboard shortcuts

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