Versions in this module Expand all Collapse all v1 v1.0.0 Jul 20, 2019 Changes in this version + var DefaultTimeout = 10 * time.Second + var Encoder = "/usr/local/bin/ffmpeg" + var ErrorCmdNotOK = errors.New("command unsuccessful") type Cameras + Names []string + Numbers []int type Server + func GetServer(user, pass, url string, verifySSL bool) (*Server, error) v0 v0.0.101 Dec 6, 2021 Changes in this version + var ErrCAMMissing = fmt.Errorf("camera number missing") + var ErrCAMParseFail = fmt.Errorf("CAM parse failed") + var ErrDateParseFail = fmt.Errorf("timestamp parse failed") + var ErrDisconnect = fmt.Errorf("server connection closed") + var ErrIDParseFail = fmt.Errorf("ID parse failed") + var ErrInvalidName = fmt.Errorf("invalid file name") + var ErrPTZNotOK = fmt.Errorf("PTZ command not OK") + var ErrPTZRange = fmt.Errorf("PTZ preset out of range 1-8") + var ErrPathExists = fmt.Errorf("cannot overwrite existing path") + var ErrUnknownEvent = fmt.Errorf("unknown event") v0.0.100 Apr 15, 2021 v0.0.1 Apr 15, 2021 Changes in this version + const BadID + const DefaultEncoder + const DownloadDateFormat + const EventBuffer + const EventTimeFormat + const FileDateFormat + const TriggerByAudio + const TriggerByCameraEvent + const TriggerByHumanDetection + const TriggerByManual + const TriggerByMotion + const TriggerByOtherCamera + const TriggerByScript + const TriggerByVehicleDetection + const TriggerByWebServer + const UnknownEventText + const UnknownReasonText + var ErrorCAMMissing = fmt.Errorf("camera number missing") + var ErrorCAMParseFail = fmt.Errorf("CAM parse failed") + var ErrorDateParseFail = fmt.Errorf("timestamp parse failed") + var ErrorDisconnect = fmt.Errorf("server connection closed") + var ErrorIDParseFail = fmt.Errorf("ID parse failed") + var ErrorInvalidName = fmt.Errorf("invalid file name") + var ErrorPTZNotOK = fmt.Errorf("PTZ command not OK") + var ErrorPTZRange = fmt.Errorf("PTZ preset out of range 1-8") + var ErrorPathExists = fmt.Errorf("cannot overwrite existing path") + var ErrorUnknownEvent = fmt.Errorf("unknown event") + var Reasons = map[TriggerEvent]string + func EventName(e EventType) string + type Camera struct + ActionResetTime Duration + ActionScriptName string + ActionSoundName string + Address string + AudioDeviceName string + AudioNetwork YesNoBool + CapturePath string + Connected YesNoBool + CurrentFPS float64 + DeviceName string + DeviceType string + HasAudio YesNoBool + Height int + MDaudioThreshold int + MDaudioTrigger YesNoBool + MDcapture YesNoBool + MDcaptureFPS float64 + MDcaptureImages YesNoBool + MDeecordAudio YesNoBool + MDenabled YesNoBool + MDpostCapture Duration + MDpreCapture Duration + MDsensitivity int + MDtriggerTimeX2 Duration + MDuploadImages YesNoBool + Mode YesNoBool + ModeA YesNoBool + ModeC YesNoBool + ModeM YesNoBool + Name string + Number int + Overlay YesNoBool + OverlayText string + PTZ *PTZ + Permissions int64 + Port int + PortRTSP int + PresetName1 string + PresetName2 string + PresetName3 string + PresetName4 string + PresetName5 string + PresetName6 string + PresetName7 string + PresetName8 string + Request string + ScheduleIDA CameraSchedule + ScheduleIDCC CameraSchedule + ScheduleIDMC CameraSchedule + ScheduleOverrideA CameraSchedule + ScheduleOverrideCC CameraSchedule + ScheduleOverrideMC CameraSchedule + TLcapture YesNoBool + TLrecordAudio YesNoBool + TimeSinceLastFrame Duration + TimeSinceLastMotion Duration + Transformation int + Width int + func (c *Camera) GetJPEG(ops *VidOps) (image.Image, error) + func (c *Camera) PostG711(audio io.ReadCloser) ([]byte, error) + func (c *Camera) SaveJPEG(ops *VidOps, path string) error + func (c *Camera) SaveVideo(ops *VidOps, length time.Duration, maxsize int64, outputFile string) error + func (c *Camera) SetSchedule(mode CameraMode, scheduleID int) error + func (c *Camera) SetScheduleOverride(mode CameraMode, overrideID int) error + func (c *Camera) StreamG711() (io.ReadCloser, error) + func (c *Camera) StreamH264(ops *VidOps) (io.ReadCloser, error) + func (c *Camera) StreamMJPG(ops *VidOps) (io.ReadCloser, error) + func (c *Camera) StreamVideo(ops *VidOps, length time.Duration, maxsize int64) (io.ReadCloser, error) + func (c *Camera) ToggleActions(arm CameraArmMode) error + func (c *Camera) ToggleContinuous(arm CameraArmMode) error + func (c *Camera) ToggleMotion(arm CameraArmMode) error + func (c *Camera) TriggerMotion() error + type CameraArmMode rune + const CameraArm + const CameraDisarm + type CameraMode rune + const CameraModeActions + const CameraModeAll + const CameraModeContinuous + const CameraModeMotion + type CameraSchedule struct + ID int + Name string + func (bit *CameraSchedule) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type Cameras struct + func (c *Cameras) All() (cams []*Camera) + func (c *Cameras) ByName(name string) *Camera + func (c *Cameras) ByNum(number int) *Camera + type Duration struct + Val string + func (bit *Duration) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type Event struct + Camera *Camera + Errors []error + ID int + Msg string + Time time.Time + Type EventType + When time.Time + func (e *Event) String() string + type EventType string + const EventAllEvents + const EventArmActions + const EventArmContinuous + const EventArmMotion + const EventClassify + const EventConfigChange + const EventDisarmActions + const EventDisarmContinuous + const EventDisarmMotion + const EventFileWritten + const EventKeepAlive + const EventMotionDetected + const EventOffline + const EventOnline + const EventSecSpyError + const EventStreamConnect + const EventStreamCustom + const EventStreamDisconnect + const EventTriggerAction + const EventTriggerMotion + const EventUnknownEvent + const EventWatcherRefreshFail + const EventWatcherRefreshed + type Events struct + Running bool + func (e *Events) BindChan(event EventType, channel chan Event) + func (e *Events) BindFunc(event EventType, callBack func(Event)) + func (e *Events) Custom(cameraNum int, msg string) + func (e *Events) Stop(closeChans bool) + func (e *Events) UnbindAll() + func (e *Events) UnbindChan(event EventType) + func (e *Events) UnbindFunc(event EventType) + func (e *Events) UnmarshalEvent(text string) Event + func (e *Events) Watch(retryInterval time.Duration, refreshOnConfigChange bool) + type File struct + Camera *Camera + CameraNum int + GmtOffset time.Duration + Link struct{ ... } + Title string + Updated time.Time + func (f *File) Get(highBandwidth bool) (io.ReadCloser, error) + func (f *File) Save(path string) (int64, error) + type Files struct + func (f *Files) GetAll(cameraNums []int, from, to time.Time) ([]*File, error) + func (f *Files) GetCCVideos(cameraNums []int, from, to time.Time) ([]*File, error) + func (f *Files) GetFile(name string) (*File, error) + func (f *Files) GetImages(cameraNums []int, from, to time.Time) ([]*File, error) + func (f *Files) GetMCVideos(cameraNums []int, from, to time.Time) ([]*File, error) + type PTZ struct + Continuous bool + HasHome bool + HasPanTilt bool + HasPresets bool + HasZoom bool + func (z *PTZ) Down() error + func (z *PTZ) DownLeft() error + func (z *PTZ) DownRight() error + func (z *PTZ) Home() error + func (z *PTZ) Left() error + func (z *PTZ) Preset(preset PTZpreset) error + func (z *PTZ) PresetSave(preset PTZpreset) error + func (z *PTZ) Right() error + func (z *PTZ) Stop() error + func (z *PTZ) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + func (z *PTZ) Up() error + func (z *PTZ) UpLeft() error + func (z *PTZ) UpRight() error + func (z *PTZ) Zoom(in bool) error + type PTZpreset rune + const PTZpreset1 + const PTZpreset2 + const PTZpreset3 + const PTZpreset4 + const PTZpreset5 + const PTZpreset6 + const PTZpreset7 + const PTZpreset8 + type ScheduleContainer map[int]string + func (m *ScheduleContainer) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type Server struct + Cameras *Cameras + Encoder string + Events *Events + Files *Files + Info *ServerInfo + func New(c *server.Config) (*Server, error) + func NewMust(c *server.Config) *Server + func (s *Server) GetScripts() ([]string, error) + func (s *Server) GetSounds() ([]string, error) + func (s *Server) Refresh() error + func (s *Server) SetSchedulePreset(presetID int) error + type ServerInfo struct + BonjourName string + CPUUsage int + CurrentTime time.Time + DDNSName string + DateFormat string + EventStreamCount int64 + GmtOffset Duration + HTTPEnabled YesNoBool + HTTPPort int + HTTPPortWan int + HTTPSEnabled YesNoBool + HTTPSPort int + HTTPSPortWan int + IP1 string + IP2 string + Name string + Refreshed time.Time + ScheduleOverrides map[int]string + SchedulePresets map[int]string + ServerName string + ServerSchedules map[int]string + TimeFormat string + UUID string + Version string + WanAddress string + type TriggerEvent int + type VidOps struct + FPS int + Height int + Quality int + Width int + type YesNoBool struct + Txt string + Val bool + func (bit *YesNoBool) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error Incompatible versions in this module v2.0.2+incompatible Sep 17, 2019 v2.0.1+incompatible Sep 12, 2019 v2.0.0+incompatible Aug 13, 2019