Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct {
Fps uint `json:"fps"`
DeviceID string `json:"deviceId"`
MinInterval time.Duration `json:"minInterval"`
MinArea float64 `json:"minArea"`
ShowVideo bool `json:"showVideo"`
Handlers []string `json:"handlers"`
DataDir string `json:"dataDir"`
MailConfig MailConfig `json:"mailConfig"`
}
Configuration holds application wide parameters
func DefaultConfiguration ¶
func DefaultConfiguration() Configuration
DefaultConfiguration returns a configuration suitable for most cases
func LoadConfiguration ¶
func LoadConfiguration(path string) (Configuration, error)
LoadConfiguration loads configuration from file
type MailConfig ¶
type MailConfig struct {
From string `json:"from"`
To string `json:"to"`
ServerHost string `json:"serverHost"`
ServerPort int `json:"serverPort"`
ServerUser string `json:"serverUser"`
ServerPassword string `json:"serverPassword"`
}
MailConfig holds mail sender configuration
type MotionDetector ¶
type MotionDetector interface {
// OpenDevice opens video capture device for motion detection
OpenDevice(deviceID string) error
// DetectMotion motion in the video capture
// Returns non nil MotionEvent when motion has been detected
// Called at fixed intervals by the driver program
DetectMotion(showVideo bool, minArea float64) (*MotionEvent, error)
// Close video capture device and perform any additional cleanup
Close()
}
MotionDetector uses the video capture device to detect motion
func NewMotionDetector ¶
func NewMotionDetector() MotionDetector
NewMotionDetector creates a motion detector based on OpenCV
type MotionEvent ¶
MotionEvent holds the image frame and the time when motion is detected
type MotionHandler ¶
type MotionHandler interface {
// Handle motion event
Handle(event *MotionEvent) error
}
MotionHandler represents a callback invoked when motion is detected
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner is the main driver for motion detection and handling
func NewRunner ¶
func NewRunner(config Configuration, detector MotionDetector) *Runner
NewRunner returns a new Runner instance
Click to show internal directories.
Click to hide internal directories.