motion

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2018 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//Read only motion config
	ConfigWebControlPort           = "webcontrol_port"
	ConfigStreamPort               = "stream_port"
	ConfigStreamAuthMethod         = "stream_auth_method"
	ConfigStreamAuthentication     = "stream_authentication"
	ConfigWebControlHTML           = "webcontrol_html_output"
	ConfigWebControlParms          = "webcontrol_parms"
	ConfigWebControlAuthentication = "webcontrol_authentication"
	ConfigProcessIdFile            = "process_id_file"
	ConfigTargetDir                = "target_dir"

	ConfigPictureType = "picture_type"
)
View Source
const (
	DetectionStatusRegex  = "Camera [0-9]+ Detection status (ACTIVE|PAUSE)"
	DetectionResumedRegex = "Camera [0-9]+ Detection resumed\nDone\n"
	DetectionPausedRegex  = "Camera [0-9]+ Detection paused\nDone\n"
	DetectionActiveRegex  = "Camera [0-9]+ Detection status ACTIVE"
	DetectionPauseRegex   = "Camera [0-9]+ Detection status PAUSE"

	SnapshotDetectionRegex = "snapshot for thread [0-9]\nDone"
)
View Source
const (
	KeyValueRegex = "[a-zA-Z0-9_%\\/\\-()]"
)

Variables

View Source
var ConfigTypeMapper = func(s string) interface{} {

	integer, err := strconv.Atoi(s)

	if err == nil {
		return integer
	}

	switch s {
	case "true":
		return true
	case "on":
		return true
	case "false":
		return false
	case "off":
		return false
	case "(null)":
		return nil
	default:
		return s
	}
}
View Source
var ReverseConfigTypeMapper = func(s string) interface{} {
	switch s {
	case "true":
		return "on"
	case "false":
		return "off"
	case "null":
		return ""
	default:
		return s
	}
}

Functions

func ConfigCanSet

func ConfigCanSet(name string) bool

func ConfigGet

func ConfigGet(param string) (interface{}, error)

func ConfigList

func ConfigList() (map[string]interface{}, error)

func ConfigSet

func ConfigSet(name string, value string) error

func ConfigWrite

func ConfigWrite() error

func DisableMotionDetection

func DisableMotionDetection() error

func EnableMotionDetection

func EnableMotionDetection() error

func GetBaseURL

func GetBaseURL() string

func GetStreamBaseURL

func GetStreamBaseURL() string

func Init

func Init(configFile string, autostart bool, detection bool) error

func IsMotionDetectionEnabled

func IsMotionDetectionEnabled() (bool, error)

func IsStarted

func IsStarted() (bool, error)

func MakeMovie added in v0.0.13

func MakeMovie() error

func Restart

func Restart() error

func Shutdown

func Shutdown() error

func Snapshot

func Snapshot() (string, error)

func Startup

func Startup(motionDetectionStartup bool) error

func TargetDirGetFile added in v0.0.9

func TargetDirGetFile(filename string) (string, error)

func TargetDirRemoveFile added in v0.0.9

func TargetDirRemoveFile(filename string) error

func TargetDirSize added in v0.0.9

func TargetDirSize() (int64, error)

Types

type TargetDirFile added in v0.0.9

type TargetDirFile struct {
	Name         string    `json:"name"`
	CreationTime time.Time `json:"creationDate"`
}

func TargetDirListFiles added in v0.0.9

func TargetDirListFiles() ([]TargetDirFile, error)

Jump to

Keyboard shortcuts

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