Documentation ¶
Index ¶
- Constants
- Variables
- func IsDevNull(path string) bool
- type ClearTimeProfilesRequest
- type ClearTimeProfilesResponse
- type ControlState
- type DateRange
- type DeleteCardRequest
- type DeleteCardResponse
- type DeleteCardsRequest
- type DeleteCardsResponse
- type DeviceID
- type DeviceSummary
- type Event
- type EventHandler
- type EventIndex
- type EventMap
- type EventMessage
- type EventRange
- type GetCardRecordsRequest
- type GetCardRecordsResponse
- type GetCardRequest
- type GetCardResponse
- type GetCardsRequest
- type GetCardsResponse
- type GetDeviceRequest
- type GetDeviceResponse
- type GetDevicesRequest
- type GetDevicesResponse
- type GetDoorControlRequest
- type GetDoorControlResponse
- type GetDoorDelayRequest
- type GetDoorDelayResponse
- type GetEventRangeRequest
- type GetEventRangeResponse
- type GetEventRequest
- type GetEventResponse
- type GetStatusRequest
- type GetStatusResponse
- type GetTimeProfileRequest
- type GetTimeProfileResponse
- type GetTimeProfilesRequest
- type GetTimeProfilesResponse
- type GetTimeRequest
- type GetTimeResponse
- type IUHPPOTED
- type ListenEvent
- type OpenDoorRequest
- type OpenDoorResponse
- type PutCardRequest
- type PutCardResponse
- type PutTaskListRequest
- type PutTaskListResponse
- type PutTimeProfileRequest
- type PutTimeProfileResponse
- type PutTimeProfilesRequest
- type PutTimeProfilesResponse
- type RecordSpecialEventsRequest
- type RecordSpecialEventsResponse
- type SetDoorControlRequest
- type SetDoorControlResponse
- type SetDoorDelayRequest
- type SetDoorDelayResponse
- type SetTimeRequest
- type SetTimeResponse
- type Status
- type StatusEvent
- type UHPPOTED
- func (u *UHPPOTED) ClearTimeProfiles(request ClearTimeProfilesRequest) (*ClearTimeProfilesResponse, error)
- func (u *UHPPOTED) DeleteCard(request DeleteCardRequest) (*DeleteCardResponse, error)
- func (u *UHPPOTED) DeleteCards(request DeleteCardsRequest) (*DeleteCardsResponse, error)
- func (u *UHPPOTED) GetCard(request GetCardRequest) (*GetCardResponse, error)
- func (u *UHPPOTED) GetCardRecords(request GetCardRecordsRequest) (*GetCardRecordsResponse, error)
- func (u *UHPPOTED) GetCards(request GetCardsRequest) (*GetCardsResponse, error)
- func (u *UHPPOTED) GetDevice(request GetDeviceRequest) (*GetDeviceResponse, error)
- func (u *UHPPOTED) GetDevices(request GetDevicesRequest) (*GetDevicesResponse, error)
- func (u *UHPPOTED) GetDoorControl(request GetDoorControlRequest) (*GetDoorControlResponse, error)
- func (u *UHPPOTED) GetDoorDelay(request GetDoorDelayRequest) (*GetDoorDelayResponse, error)
- func (u *UHPPOTED) GetEvent(request GetEventRequest) (*GetEventResponse, error)
- func (u *UHPPOTED) GetEventRange(request GetEventRangeRequest) (*GetEventRangeResponse, error)
- func (u *UHPPOTED) GetStatus(request GetStatusRequest) (*GetStatusResponse, error)
- func (u *UHPPOTED) GetTime(request GetTimeRequest) (*GetTimeResponse, error)
- func (u *UHPPOTED) GetTimeProfile(request GetTimeProfileRequest) (*GetTimeProfileResponse, error)
- func (u *UHPPOTED) GetTimeProfiles(request GetTimeProfilesRequest) (*GetTimeProfilesResponse, error)
- func (u *UHPPOTED) Listen(handler EventHandler, received *EventMap, q chan os.Signal)
- func (u *UHPPOTED) OpenDoor(request OpenDoorRequest) (*OpenDoorResponse, error)
- func (u *UHPPOTED) PutCard(request PutCardRequest) (*PutCardResponse, error)
- func (u *UHPPOTED) PutTaskList(request PutTaskListRequest) (*PutTaskListResponse, int, error)
- func (u *UHPPOTED) PutTimeProfile(request PutTimeProfileRequest) (*PutTimeProfileResponse, error)
- func (u *UHPPOTED) PutTimeProfiles(request PutTimeProfilesRequest) (*PutTimeProfilesResponse, int, error)
- func (u *UHPPOTED) RecordSpecialEvents(request RecordSpecialEventsRequest) (*RecordSpecialEventsResponse, error)
- func (u *UHPPOTED) SetDoorControl(request SetDoorControlRequest) (*SetDoorControlResponse, error)
- func (u *UHPPOTED) SetDoorDelay(request SetDoorDelayRequest) (*SetDoorDelayResponse, error)
- func (u *UHPPOTED) SetTime(request SetTimeRequest) (*SetTimeResponse, error)
Constants ¶
View Source
const ( StatusOK = http.StatusOK StatusBadRequest = http.StatusBadRequest StatusNotFound = http.StatusNotFound StatusInternalServerError = http.StatusInternalServerError )
View Source
const BATCHSIZE = 32
View Source
const ROLLOVER = uint32(100000)
Variables ¶
Functions ¶
Types ¶
type ClearTimeProfilesRequest ¶
type ClearTimeProfilesRequest struct {
DeviceID uint32
}
type ControlState ¶
type ControlState uint8
const ( NormallyOpen ControlState = 1 NormallyClosed ControlState = 2 Controlled ControlState = 3 )
func (ControlState) MarshalJSON ¶
func (s ControlState) MarshalJSON() ([]byte, error)
func (*ControlState) UnmarshalJSON ¶
func (s *ControlState) UnmarshalJSON(bytes []byte) (err error)
type DateRange ¶
type DeleteCardRequest ¶
type DeleteCardResponse ¶
type DeleteCardsRequest ¶
type DeleteCardsRequest struct {
DeviceID DeviceID
}
type DeleteCardsResponse ¶
type DeviceSummary ¶
type DeviceSummary struct { DeviceType string `json:"device-type"` Address net.IP `json:"ip-address"` Port int `json:"port"` }
TODO rename Address to IpAddress and use Address for IP:Port
type Event ¶
type Event struct { Index uint32 `json:"event-id"` Type uint8 `json:"event-type"` Granted bool `json:"access-granted"` Door uint8 `json:"door-id"` Direction uint8 `json:"direction"` CardNumber uint32 `json:"card-number"` Timestamp types.DateTime `json:"timestamp"` Reason uint8 `json:"event-reason"` }
type EventHandler ¶
type EventHandler func(EventMessage) bool
type EventIndex ¶
type EventIndex uint32
type EventMap ¶
type EventMap struct {
// contains filtered or unexported fields
}
func NewEventMap ¶
type EventMessage ¶
type EventMessage struct {
Event ListenEvent `json:"event"`
}
type EventRange ¶
type EventRange struct { First *uint32 `json:"first,omitempty"` Last *uint32 `json:"last,omitempty"` }
func (*EventRange) String ¶
func (e *EventRange) String() string
type GetCardRecordsRequest ¶
type GetCardRecordsRequest struct {
DeviceID DeviceID
}
type GetCardRecordsResponse ¶
type GetCardRequest ¶
type GetCardResponse ¶
type GetCardsRequest ¶
type GetCardsRequest struct {
DeviceID DeviceID
}
type GetCardsResponse ¶
type GetDeviceRequest ¶
type GetDeviceRequest struct {
DeviceID DeviceID
}
type GetDeviceResponse ¶
type GetDeviceResponse struct { DeviceType string `json:"device-type"` DeviceID DeviceID `json:"device-id"` IpAddress net.IP `json:"ip-address"` SubnetMask net.IP `json:"subnet-mask"` Gateway net.IP `json:"gateway-address"` MacAddress types.MacAddress `json:"mac-address"` Version types.Version `json:"version"` Date types.Date `json:"date"` Address net.UDPAddr `json:"address"` TimeZone *time.Location `json:"timezone,omitempty"` }
type GetDevicesRequest ¶
type GetDevicesRequest struct { }
type GetDevicesResponse ¶
type GetDevicesResponse struct {
Devices map[uint32]DeviceSummary `json:"devices"`
}
type GetDoorControlRequest ¶
type GetDoorControlResponse ¶
type GetDoorControlResponse struct { DeviceID DeviceID `json:"device-id"` Door uint8 `json:"door"` Control ControlState `json:"control"` }
type GetDoorDelayRequest ¶
type GetDoorDelayResponse ¶
type GetEventRangeRequest ¶
type GetEventRangeResponse ¶
type GetEventRangeResponse struct { DeviceID DeviceID `json:"device-id,omitempty"` Dates *DateRange `json:"dates,omitempty"` Events *EventRange `json:"events,omitempty"` }
type GetEventRequest ¶
type GetEventResponse ¶
type GetStatusRequest ¶
type GetStatusRequest struct {
DeviceID DeviceID
}
type GetStatusResponse ¶
type GetTimeProfileRequest ¶
type GetTimeProfileResponse ¶
type GetTimeProfileResponse struct { DeviceID DeviceID `json:"device-id"` TimeProfile types.TimeProfile `json:"time-profile"` }
type GetTimeProfilesRequest ¶
type GetTimeProfilesResponse ¶
type GetTimeProfilesResponse struct { DeviceID DeviceID `json:"device-id"` Profiles []types.TimeProfile `json:"profiles"` }
type GetTimeRequest ¶
type GetTimeRequest struct {
DeviceID DeviceID
}
type GetTimeResponse ¶
type IUHPPOTED ¶
type IUHPPOTED interface { GetDevices(request GetDevicesRequest) (*GetDevicesResponse, error) GetDevice(request GetDeviceRequest) (*GetDeviceResponse, error) GetTime(request GetTimeRequest) (*GetTimeResponse, error) SetTime(request SetTimeRequest) (*SetTimeResponse, error) GetDoorDelay(request GetDoorDelayRequest) (*GetDoorDelayResponse, error) SetDoorDelay(request SetDoorDelayRequest) (*SetDoorDelayResponse, error) GetDoorControl(request GetDoorControlRequest) (*GetDoorControlResponse, error) SetDoorControl(request SetDoorControlRequest) (*SetDoorControlResponse, error) RecordSpecialEvents(request RecordSpecialEventsRequest) (*RecordSpecialEventsResponse, error) GetStatus(request GetStatusRequest) (*GetStatusResponse, error) GetCardRecords(request GetCardRecordsRequest) (*GetCardRecordsResponse, error) GetCards(request GetCardsRequest) (*GetCardsResponse, error) DeleteCards(request DeleteCardsRequest) (*DeleteCardsResponse, error) GetCard(request GetCardRequest) (*GetCardResponse, error) PutCard(request PutCardRequest) (*PutCardResponse, error) DeleteCard(request DeleteCardRequest) (*DeleteCardResponse, error) GetTimeProfiles(request GetTimeProfilesRequest) (*GetTimeProfilesResponse, error) PutTimeProfiles(request PutTimeProfilesRequest) (*PutTimeProfilesResponse, int, error) GetTimeProfile(request GetTimeProfileRequest) (*GetTimeProfileResponse, error) PutTimeProfile(request PutTimeProfileRequest) (*PutTimeProfileResponse, error) ClearTimeProfiles(request ClearTimeProfilesRequest) (*ClearTimeProfilesResponse, error) PutTaskList(request PutTaskListRequest) (*PutTaskListResponse, int, error) GetEventRange(request GetEventRangeRequest) (*GetEventRangeResponse, error) GetEvent(request GetEventRequest) (*GetEventResponse, error) OpenDoor(request OpenDoorRequest) (*OpenDoorResponse, error) }
type ListenEvent ¶
type ListenEvent struct { DeviceID DeviceID `json:"device-id"` EventID uint32 `json:"event-id"` Type uint8 `json:"event-type"` Granted bool `json:"access-granted"` Door uint8 `json:"door-id"` Direction uint8 `json:"direction"` CardNumber uint32 `json:"card-number"` Timestamp types.DateTime `json:"timestamp"` Reason uint8 `json:"event-reason"` }
type OpenDoorRequest ¶
type OpenDoorResponse ¶
type PutCardRequest ¶
type PutCardResponse ¶
type PutTaskListRequest ¶
type PutTaskListResponse ¶
type PutTimeProfileRequest ¶
type PutTimeProfileRequest struct { DeviceID uint32 TimeProfile types.TimeProfile }
type PutTimeProfileResponse ¶
type PutTimeProfileResponse struct { DeviceID DeviceID `json:"device-id"` TimeProfile types.TimeProfile `json:"time-profile"` }
type PutTimeProfilesRequest ¶
type PutTimeProfilesRequest struct { DeviceID uint32 Profiles []types.TimeProfile `json:"profiles"` }
type PutTimeProfilesResponse ¶
type SetDoorControlRequest ¶
type SetDoorControlRequest struct { DeviceID DeviceID Door uint8 Control ControlState }
type SetDoorControlResponse ¶
type SetDoorControlResponse struct { DeviceID DeviceID `json:"device-id"` Door uint8 `json:"door"` Control ControlState `json:"control"` }
type SetDoorDelayRequest ¶
type SetDoorDelayResponse ¶
type SetTimeRequest ¶
type SetTimeResponse ¶
type Status ¶
type Status struct { DoorState map[uint8]bool `json:"door-states"` DoorButton map[uint8]bool `json:"door-buttons"` SystemError uint8 `json:"system-error"` SystemDateTime types.DateTime `json:"system-datetime"` SequenceId uint32 `json:"sequence-id"` SpecialInfo uint8 `json:"special-info"` RelayState uint8 `json:"relay-state"` InputState uint8 `json:"input-state"` Event *StatusEvent `json:"event,omitempty"` }
type StatusEvent ¶
type UHPPOTED ¶
func (*UHPPOTED) ClearTimeProfiles ¶
func (u *UHPPOTED) ClearTimeProfiles(request ClearTimeProfilesRequest) (*ClearTimeProfilesResponse, error)
func (*UHPPOTED) DeleteCard ¶
func (u *UHPPOTED) DeleteCard(request DeleteCardRequest) (*DeleteCardResponse, error)
func (*UHPPOTED) DeleteCards ¶
func (u *UHPPOTED) DeleteCards(request DeleteCardsRequest) (*DeleteCardsResponse, error)
func (*UHPPOTED) GetCard ¶
func (u *UHPPOTED) GetCard(request GetCardRequest) (*GetCardResponse, error)
func (*UHPPOTED) GetCardRecords ¶
func (u *UHPPOTED) GetCardRecords(request GetCardRecordsRequest) (*GetCardRecordsResponse, error)
func (*UHPPOTED) GetCards ¶
func (u *UHPPOTED) GetCards(request GetCardsRequest) (*GetCardsResponse, error)
func (*UHPPOTED) GetDevice ¶
func (u *UHPPOTED) GetDevice(request GetDeviceRequest) (*GetDeviceResponse, error)
func (*UHPPOTED) GetDevices ¶
func (u *UHPPOTED) GetDevices(request GetDevicesRequest) (*GetDevicesResponse, error)
func (*UHPPOTED) GetDoorControl ¶
func (u *UHPPOTED) GetDoorControl(request GetDoorControlRequest) (*GetDoorControlResponse, error)
func (*UHPPOTED) GetDoorDelay ¶
func (u *UHPPOTED) GetDoorDelay(request GetDoorDelayRequest) (*GetDoorDelayResponse, error)
func (*UHPPOTED) GetEvent ¶
func (u *UHPPOTED) GetEvent(request GetEventRequest) (*GetEventResponse, error)
func (*UHPPOTED) GetEventRange ¶
func (u *UHPPOTED) GetEventRange(request GetEventRangeRequest) (*GetEventRangeResponse, error)
func (*UHPPOTED) GetStatus ¶
func (u *UHPPOTED) GetStatus(request GetStatusRequest) (*GetStatusResponse, error)
func (*UHPPOTED) GetTime ¶
func (u *UHPPOTED) GetTime(request GetTimeRequest) (*GetTimeResponse, error)
func (*UHPPOTED) GetTimeProfile ¶
func (u *UHPPOTED) GetTimeProfile(request GetTimeProfileRequest) (*GetTimeProfileResponse, error)
func (*UHPPOTED) GetTimeProfiles ¶
func (u *UHPPOTED) GetTimeProfiles(request GetTimeProfilesRequest) (*GetTimeProfilesResponse, error)
func (*UHPPOTED) Listen ¶
func (u *UHPPOTED) Listen(handler EventHandler, received *EventMap, q chan os.Signal)
func (*UHPPOTED) OpenDoor ¶
func (u *UHPPOTED) OpenDoor(request OpenDoorRequest) (*OpenDoorResponse, error)
func (*UHPPOTED) PutCard ¶
func (u *UHPPOTED) PutCard(request PutCardRequest) (*PutCardResponse, error)
func (*UHPPOTED) PutTaskList ¶
func (u *UHPPOTED) PutTaskList(request PutTaskListRequest) (*PutTaskListResponse, int, error)
func (*UHPPOTED) PutTimeProfile ¶
func (u *UHPPOTED) PutTimeProfile(request PutTimeProfileRequest) (*PutTimeProfileResponse, error)
func (*UHPPOTED) PutTimeProfiles ¶
func (u *UHPPOTED) PutTimeProfiles(request PutTimeProfilesRequest) (*PutTimeProfilesResponse, int, error)
func (*UHPPOTED) RecordSpecialEvents ¶
func (u *UHPPOTED) RecordSpecialEvents(request RecordSpecialEventsRequest) (*RecordSpecialEventsResponse, error)
Unwraps the request and dispatches the corresponding controller command to enable or disable door open, door close and door button press events for the controller.
func (*UHPPOTED) SetDoorControl ¶
func (u *UHPPOTED) SetDoorControl(request SetDoorControlRequest) (*SetDoorControlResponse, error)
func (*UHPPOTED) SetDoorDelay ¶
func (u *UHPPOTED) SetDoorDelay(request SetDoorDelayRequest) (*SetDoorDelayResponse, error)
func (*UHPPOTED) SetTime ¶
func (u *UHPPOTED) SetTime(request SetTimeRequest) (*SetTimeResponse, error)
Click to show internal directories.
Click to hide internal directories.