Documentation ¶
Overview ¶
Package axisevents simplifies the configuration of events such as record video to sd-card when the device detects motion detection
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface { // With specify your Do function. With(do func(req *http.Request)) Command // ExecuteOn the event on the specified device. ExecuteOn(ctx context.Context, device Device) error }
Command executes the request.
type Device ¶
type Device struct { Username string Password string Address string // Address must be in format of http://ip/ or http://hostname/ or if the device is configured for ssl https://ip/ }
Device holds the connection info for the device
type HTTPNotificationHandler ¶
type HTTPNotificationHandler interface { // NotifyEmptyQueryString will set an empty query string NotifyEmptyQueryString() RecipientsHandler // Notify message = testing, parameters = source=livingroom will give the result Message=testing&source=livingroom Notify(message string, parameters string) RecipientsHandler }
HTTPNotificationHandler configures the querystring e.g. http://192.168.1.106?Message=testing&source=livingroom
type MotionDetectionHandler ¶
type MotionDetectionHandler interface { // Send http notifications when motion is detected. HttpNotification() HTTPNotificationHandler // Record motion. Record() RecordVideoHandler }
MotionDetectionHandler defines operations to use when a device detects motion.
func NewMotionDetectionHandler ¶
func NewMotionDetectionHandler(name string, enabled bool, version int) MotionDetectionHandler
NewMotionDetectionHandler creates a new MotionDetectionHandler which is used to define what happens when a device detects motion.
Supported versions: 2,3,4 defaults to version 2 Supported actions: Record video to the device SD-card.
type RecipientsHandler ¶
type RecipientsHandler interface { // Http get request. HTTP(url string, username string, password string, proxy string, proxyPort string, proxyUsername string, proxyPassword string, qos string) Command }
RecipientsHandler definies recipients such as http, https etc.
type RecordVideoHandler ¶
type RecordVideoHandler interface { Video() SdCardHandler VideoCustom(prebuffer int, postbuffer int, streamprofile string) SdCardHandler }
RecordVideoHandler settings for the video.
type SdCardHandler ¶
type SdCardHandler interface {
SdCard() Command
}
SdCardHandler record to the device sd-card.