Documentation
¶
Index ¶
- type API
- type AlertCommon
- type AlertFilter
- type Alerts
- type App
- type AppriseAPI
- type Cameras
- type Discord
- type Event
- type ExtraFields
- type Frigate
- type FrigateConnection
- type General
- type Gotify
- type HTTP
- type Internal
- type InternalConfig
- type Labels
- type LicensePlate
- type MQTT
- type MQTTEvent
- type MQTTReview
- type Matrix
- type Mattermost
- type Monitor
- type NotifierStatus
- type Notifiers
- type Ntfy
- type Pushover
- type Quiet
- type Review
- type SMTP
- type Signal
- type StartupCheck
- type Status
- type Telegram
- type WebAPI
- type Webhook
- type Zones
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertCommon ¶ added in v0.5.0
type AlertCommon struct {
Enabled bool `koanf:"enabled" json:"enabled" enum:"true,false" doc:"Enable notifications via this provider" default:"false"`
Title string `koanf:"title" json:"title,omitempty" doc:"Title for alerts from this provider"`
Template string `koanf:"template" json:"template,omitempty" doc:"Custom message template" default:""`
Filters AlertFilter `koanf:"filters" json:"filters,omitempty" doc:"Filter notifications sent via this provider"`
}
type AlertFilter ¶ added in v0.4.0
type AlertFilter struct {
Cameras []string `koanf:"cameras" json:"cameras,omitempty" doc:"List of cameras that will use this alert provider"`
Zones []string `koanf:"zones" json:"zones,omitempty" doc:"List of zones that will use this alert provider"`
Quiet Quiet `koanf:"quiet" json:"quiet,omitempty" doc:"Quiet period for this alert provider"`
Labels []string `koanf:"labels" json:"labels,omitempty" doc:"List of labels that will use this alert provider"`
Sublabels []string `koanf:"sublabels" json:"sublabels,omitempty" doc:"List of sublabels that will use this alert provider"`
}
type Alerts ¶ added in v0.4.0
type Alerts struct {
General General `koanf:"general" json:"general,omitempty" doc:"Common alert settings"`
Quiet Quiet `koanf:"quiet" json:"quiet,omitempty" doc:"Alert quiet periods"`
Zones Zones `koanf:"zones" json:"zones,omitempty" doc:"Allow/Block zones from alerting"`
Labels Labels `koanf:"labels" json:"labels,omitempty" doc:"Allow/Block labels from alerting"`
SubLabels Labels `koanf:"sublabels" json:"sublabels,omitempty" doc:"Allow/Block sublabels from alerting"`
LicensePlate LicensePlate `koanf:"license_plate" json:"license_plate,omitempty" doc:"License plate recognition settings"`
AppriseAPI []AppriseAPI `koanf:"apprise_api" json:"apprise_api,omitempty" doc:"Apprise API notification settings"`
Discord []Discord `koanf:"discord" json:"discord,omitempty" doc:"Discord notification settings"`
Gotify []Gotify `koanf:"gotify" json:"gotify,omitempty" doc:"Gotify notification settings"`
Matrix []Matrix `koanf:"matrix" json:"matrix,omitempty" doc:"Matrix notification settings"`
Mattermost []Mattermost `koanf:"mattermost" json:"mattermost,omitempty" doc:"Mattermost notification settings"`
Ntfy []Ntfy `koanf:"ntfy" json:"ntfy,omitempty" doc:"Ntfy notification settings"`
Pushover []Pushover `koanf:"pushover" json:"pushover,omitempty" doc:"Pushover notification settings"`
Signal []Signal `koanf:"signal" json:"signal,omitempty" doc:"Signal notification settings"`
SMTP []SMTP `koanf:"smtp" json:"smtp,omitempty" doc:"SMTP notification settings"`
Telegram []Telegram `koanf:"telegram" json:"telegram,omitempty" doc:"Telegram notification settings"`
Webhook []Webhook `koanf:"webhook" json:"webhook,omitempty" doc:"Webhook notification settings"`
}
type App ¶ added in v0.4.0
type App struct {
Mode string `koanf:"mode" json:"mode" enum:"events,reviews" doc:"Type of polling method used when connecting to Frigate" default:"reviews"`
API API `koanf:"api" json:"api" doc:"Frigate-Notify API settings"`
Internal Internal `koanf:"internal" json:"internal,omitempty" hidden:"true" doc:"Internal settings that alter the behavior of Frigate-Notify"`
}
type AppriseAPI ¶ added in v0.4.3
type AppriseAPI struct {
AlertCommon `koanf:",squash"`
Server string `koanf:"server" json:"server,omitempty" doc:"Apprise API URL to send alerts" default:""`
Token string `koanf:"token" json:"token,omitempty" doc:"Apprise API config token"`
Tags []string `koanf:"tags" json:"tags,omitempty" doc:"Notification group tags to receive alert"`
URLs []string `koanf:"urls" json:"urls,omitempty" doc:"Apprise notification URLs to send alerts to"`
Insecure bool `koanf:"ignoressl" json:"ignoressl,omitempty" doc:"Ignore TLS/SSL errors" default:"false"`
}
type Cameras ¶ added in v0.4.0
type Cameras struct {
Exclude []string `koanf:"exclude" json:"exclude" uniqueItems:"true" doc:"Exclude cameras from alerting"`
}
type Discord ¶ added in v0.4.0
type Discord struct {
AlertCommon `koanf:",squash"`
Webhook string `koanf:"webhook" json:"webhook,omitempty" doc:"Discord webhook URL to send alerts" default:""`
DisableEmbed bool `koanf:"disable_embed" json:"disable_embed,omitempty" doc:"Disable sending notification as Discord embedded message"`
}
type Event ¶
type Event struct {
Area interface{} `json:"area"`
Box interface{} `json:"box"`
Camera string `json:"camera"`
Data struct {
Attributes []struct {
Label string `json:"label"`
} `json:"attributes"`
Box []float64 `json:"box"`
Region []float64 `json:"region"`
Score float64 `json:"score"`
TopScore float64 `json:"top_score"`
Type string `json:"type"`
RecognizedLicensePlate string `json:"recognized_license_plate"`
RecognizedLicensePlateScore float64 `json:"recognized_license_plate_score"`
} `json:"data"`
EndTime interface{} `json:"end_time"`
FalsePositive interface{} `json:"false_positive"`
HasClip bool `json:"has_clip"`
HasSnapshot bool `json:"has_snapshot"`
ID string `json:"id"`
Label string `json:"label"`
PlusID interface{} `json:"plus_id"`
Ratio interface{} `json:"ratio"`
Region interface{} `json:"region"`
RetainIndefinitely bool `json:"retain_indefinitely"`
StartTime float64 `json:"start_time"`
SubLabel string `json:"sub_label"`
Thumbnail string `json:"thumbnail"`
TopScore float64 `json:"top_score"`
Zones []string `json:"zones"`
CurrentZones []string `json:"current_zones"`
EnteredZones []string `json:"entered_zones"`
Extra ExtraFields
}
Event stores Frigate alert attributes
type ExtraFields ¶
type ExtraFields struct {
FormattedTime string
UnixStartTime int64
TopScorePercent string
LicensePlatePercent string
LabelList string
SubLabelList string
LicensePlateList string
ZoneList string
LocalURL string
PublicURL string
FrigateMajorVersion int
EventLink string
ReviewLink string
CameraName string
Audio string
}
Additional custom fields
type Frigate ¶ added in v0.4.0
type Frigate struct {
Server string `` /* 135-byte string literal not displayed */
Insecure bool `koanf:"ignoressl" json:"ignoressl,omitempty" enum:"true,false" doc:"Ignore TLS/SSL errors" default:"false"`
PublicURL string `` /* 136-byte string literal not displayed */
Username string `koanf:"username" json:"username,omitempty" doc:"Frigate username" default:""`
Password string `koanf:"password" json:"password,omitempty" doc:"Frigate password" default:""`
Headers []map[string]string `koanf:"headers" json:"headers,omitempty" doc:"HTTP headers to include with requests to Frigate"`
StartupCheck StartupCheck `koanf:"startup_check" json:"startup_check,omitempty" doc:"Check connectivity to Frigate at app startup"`
WebAPI WebAPI `koanf:"webapi" json:"webapi,omitempty" doc:"Event collection via Frigate API"`
MQTT MQTT `koanf:"mqtt" json:"mqtt,omitempty" doc:"Event collection via MQTT"`
Cameras Cameras `koanf:"cameras" json:"cameras,omitempty" doc:"Camera settings"`
}
type FrigateConnection ¶ added in v0.4.0
type General ¶ added in v0.4.0
type General struct {
Title string `koanf:"title" json:"title,omitempty" doc:"Notification title" default:"Frigate Alert"`
TimeFormat string `koanf:"timeformat" json:"timeformat,omitempty" doc:"Time format used in notifications" default:""`
NoSnap string `` /* 127-byte string literal not displayed */
SnapBbox bool `koanf:"snap_bbox,omitempty" json:"snap_bbox" enum:"true,false" doc:"Include bounding box on snapshots" default:"false"`
SnapTimestamp bool `koanf:"snap_timestamp,omitempty" json:"snap_timestamp" enum:"true,false" doc:"Include timestamp on snapshots" default:"false"`
SnapCrop bool `koanf:"snap_crop,omitempty" json:"snap_crop" enum:"true,false" doc:"Crop snapshots" default:"false"`
SnapHiRes bool `` /* 132-byte string literal not displayed */
MaxSnapRetry int `` /* 137-byte string literal not displayed */
NotifyOnce bool `` /* 139-byte string literal not displayed */
NotifyDetections bool `` /* 158-byte string literal not displayed */
RecheckDelay int `koanf:"recheck_delay" json:"recheck_delay,omitempty" default:"0" doc:"Delay before re-checking event details from Frigate"`
AudioOnly string `` /* 139-byte string literal not displayed */
}
type Gotify ¶ added in v0.4.0
type Gotify struct {
AlertCommon `koanf:",squash"`
Server string `koanf:"server" json:"server,omitempty" doc:"Gotify server URL" default:""`
Token string `koanf:"token" json:"token,omitempty" doc:"Gotify app token" default:""`
Insecure bool `koanf:"ignoressl" json:"ignoressl,omitempty" doc:"Ignore TLS/SSL errors" default:"false"`
Priority int `koanf:"priority" json:"priority,omitempty" minimum:"0" maximum:"10" doc:"Gotify message priority" default:"0"`
}
type Internal ¶ added in v0.5.3
type Internal struct {
HTTP HTTP `koanf:"http" json:"http,omitempty" doc:"Frigate-Notify outbound HTTP settings"`
}
type InternalConfig ¶ added in v0.4.0
Store internal-use only info
type Labels ¶ added in v0.4.0
type Labels struct {
MinScore float64 `koanf:"min_score" json:"min_score" minimum:"0" maximum:"100" doc:"Set minimum score before events will notify" default:"0"`
Allow []string `koanf:"allow" json:"allow,omitempty" doc:"List of labels to allow alerts from" `
Block []string `koanf:"block" json:"block,omitempty" doc:"List of labels to always block"`
}
type LicensePlate ¶ added in v0.4.4
type MQTT ¶ added in v0.4.0
type MQTT struct {
Enabled bool `koanf:"enabled" json:"enabled" enum:"true,false" doc:"Enable event collection via MQTT" default:"false"`
Server string `koanf:"server" json:"server,omitempty" doc:"MQTT server address" default:""`
Port int `koanf:"port" json:"port,omitempty" doc:"MQTT port" minimum:"1" maximum:"65535" default:"1883"`
ClientID string `koanf:"clientid" json:"clientid,omitempty" doc:"MQTT client ID" default:"frigate-notify"`
Username string `koanf:"username" json:"username,omitempty" doc:"MQTT username" default:""`
Password string `koanf:"password" json:"password,omitempty" doc:"MQTT password" default:""`
TopicPrefix string `koanf:"topic_prefix" json:"topic_prefix,omitempty" doc:"MQTT topic prefix" default:"frigate"`
}
type MQTTEvent ¶
type MQTTEvent struct {
Before struct {
Event
} `json:"before,omitempty"`
After struct {
Event
} `json:"after,omitempty"`
Type string `json:"type"`
}
MQTTEvent stores incoming MQTT payloads from Frigate
type MQTTReview ¶ added in v0.4.0
type Matrix ¶ added in v0.4.4
type Matrix struct {
AlertCommon `koanf:",squash"`
Server string `koanf:"server" json:"server,omitempty" doc:"Matrix Homeserver address" default:""`
Username string `koanf:"username" json:"username,omitempty" doc:"Matrix username" default:""`
Password string `koanf:"password" json:"password,omitempty" doc:"Matrix password" default:""`
RoomID string `koanf:"roomid" json:"roomid,omitempty" doc:"Room ID to send notifications to" default:""`
Insecure bool `koanf:"ignoressl" json:"ignoressl,omitempty" doc:"Ignore TLS/SSL errors" default:"false"`
}
type Mattermost ¶ added in v0.4.1
type Mattermost struct {
AlertCommon `koanf:",squash"`
Webhook string `koanf:"webhook" json:"webhook,omitempty" doc:"Mattermost webhook URL" default:""`
Channel string `koanf:"channel" json:"channel,omitempty" doc:"Mattermost channel" default:""`
Priority string `` /* 128-byte string literal not displayed */
Username string `koanf:"username" json:"username,omitempty" doc:"Override Mattermost username for messages"`
Insecure bool `koanf:"ignoressl" json:"ignoressl,omitempty" doc:"Ignore TLS/SSL errors" default:"false"`
Headers []map[string]string `koanf:"headers" json:"headers,omitempty" doc:"HTTP headers to include with Mattermost notifications" `
}
type Monitor ¶ added in v0.4.0
type Monitor struct {
Enabled bool `koanf:"enabled" json:"enabled" enum:"true,false" doc:"Enable monitoring via external uptime application" default:"false"`
URL string `koanf:"url" json:"url,omitempty" doc:"Address of monitoring server" default:""`
Interval int `` /* 127-byte string literal not displayed */
Insecure bool `koanf:"ignoressl" json:"ignoressl,omitempty" enum:"true,false" doc:"Ignore TLS/SSL errors" default:"false"`
}
type NotifierStatus ¶ added in v0.4.0
type NotifierStatus struct {
ID int `json:"id"`
Enabled bool `json:"enabled" doc:"Whether notification provider is enabled"`
Status string `json:"status" default:"not enabled"`
Sent int64 `json:"sent" doc:"Number of notifications sent via this provider"`
Failed int64 `json:"failed" doc:"Number of errors while attempting to send notifications via this provider"`
LastSuccess time.Time `json:"last_success" doc:"Timestamp of last successful notification sent"`
LastFailure time.Time `json:"last_failure" doc:"Timestamp of last failure to send notification"`
LastError string `json:"last_error" doc:"Error message from last failure, if applicable" default:"n/a"`
}
func (*NotifierStatus) InitNotifStatus ¶ added in v0.4.0
func (n *NotifierStatus) InitNotifStatus(id int, enabled bool)
func (*NotifierStatus) NotifFailure ¶ added in v0.4.0
func (n *NotifierStatus) NotifFailure(message string)
func (*NotifierStatus) NotifSuccess ¶ added in v0.4.0
func (n *NotifierStatus) NotifSuccess()
type Notifiers ¶ added in v0.4.0
type Notifiers struct {
Enabled bool `json:"enabled" example:"true" doc:"State of whether Frigate-Notify is enabled for notifications"`
AppriseAPI []NotifierStatus `json:"apprise_api" doc:"Status of Apprise API notifications"`
Discord []NotifierStatus `json:"discord" doc:"Status of Discord notifications"`
Gotify []NotifierStatus `json:"gotify" doc:"Status of Gotify notifications"`
Matrix []NotifierStatus `json:"matrix" doc:"Status of Matrix notifications"`
Mattermost []NotifierStatus `json:"mattermost" doc:"Status of Mattermost notifications"`
Ntfy []NotifierStatus `json:"ntfy" doc:"Status of Ntfy notifications"`
Pushover []NotifierStatus `json:"pushover" doc:"Status of Pushover notifications"`
Signal []NotifierStatus `json:"signal" doc:"Status of Signal notifications"`
SMTP []NotifierStatus `json:"smtp" doc:"Status of SMTP notifications"`
Telegram []NotifierStatus `json:"telegram" doc:"Status of Telegram notifications"`
Webhook []NotifierStatus `json:"webhook" doc:"Status of Webhook notifications"`
}
type Ntfy ¶ added in v0.4.0
type Ntfy struct {
AlertCommon `koanf:",squash"`
Server string `koanf:"server" json:"server,omitempty" doc:"Ntfy Server address" default:""`
Topic string `koanf:"topic" json:"topic,omitempty" doc:"Ntfy topic" default:""`
Insecure bool `koanf:"ignoressl" json:"ignoressl,omitempty" doc:"Ignore TLS/SSL errors" default:"false"`
Headers []map[string]string `koanf:"headers" json:"headers,omitempty" doc:"HTTP headers to include with Ntfy notifications"`
}
type Pushover ¶ added in v0.4.0
type Pushover struct {
AlertCommon `koanf:",squash"`
Token string `koanf:"token" json:"token,omitempty" doc:"Pushover app token" default:""`
Userkey string `koanf:"userkey" json:"userkey,omitempty" doc:"Pushover user key" default:""`
Devices string `koanf:"devices" json:"devices,omitempty" doc:"Pushover devices to target for notification" default:""`
Sound string `koanf:"sound" json:"sound,omitempty" doc:"Pushover notification sound" default:"pushover"`
Priority int `koanf:"priority" json:"priority,omitempty" minimum:"-2" maximum:"2" doc:"Pushover message priority" default:"0"`
Retry int `koanf:"retry" json:"retry,omitempty" doc:"Retry interval for emergency notifications (Priority 2)" default:"0"`
Expire int `koanf:"expire" json:"expire,omitempty" doc:"Expiration timer for emergency notifications (Priority 2)" default:"0"`
TTL int `koanf:"ttl" json:"ttl,omitempty" doc:"Time to Live for notification messages" default:"0"`
}
type Review ¶ added in v0.4.0
type Review struct {
ID string `json:"id"`
Camera string `json:"camera"`
StartTime float64 `json:"start_time"`
EndTime float64 `json:"end_time"`
Severity string `json:"severity"`
ThumbPath string `json:"thumb_path"`
Data struct {
Detections []string `json:"detections"`
Objects []string `json:"objects"`
SubLabels []string `json:"sub_labels"`
Zones []string `json:"zones"`
Audio []string `json:"audio"`
}
}
type SMTP ¶ added in v0.4.0
type SMTP struct {
AlertCommon `koanf:",squash"`
Server string `koanf:"server" json:"server,omitempty" doc:"SMTP server hostname or IP address" default:""`
Port int `koanf:"port" json:"port,omitempty" minimum:"1" maximum:"65535" doc:"SMTP server port" default:"25"`
TLS bool `koanf:"tls" json:"tls,omitempty" enum:"true,false" doc:"Enable/Disable TLS connection" default:"false"`
AuthType string `` /* 231-byte string literal not displayed */
User string `koanf:"user" json:"user,omitempty" doc:"SMTP user for authentication" default:""`
Password string `koanf:"password" json:"password,omitempty" doc:"SMTP password for authentication" default:""`
From string `koanf:"from" json:"from,omitempty" format:"email" doc:"SMTP sender" default:""`
Recipient string `koanf:"recipient" json:"recipient,omitempty" format:"email" doc:"SMTP recipient" default:""`
Thread string `koanf:"thread" json:"thread" enum:"day,camera" doc:"Specify method of email threading" default:"day"`
Insecure bool `koanf:"ignoressl" enum:"true,false" json:"ignoressl,omitempty" default:"false"`
MsgUUID bool `koanf:"msguuid" json:"msguuid,omitempty" enum:"true,false" doc:"Generate message-id from uuid" default:"false"`
}
type Signal ¶ added in v0.4.1
type Signal struct {
AlertCommon `koanf:",squash"`
Server string `koanf:"server" json:"server,omitempty" doc:"Signal REST API server hostname or IP address" default:""`
Account string `koanf:"account" json:"account,omitempty" doc:"Number of account used to send messages" default:""`
Recipients []string `koanf:"recipients" json:"recipients,omitempty" doc:"List of recipients to receive messages"`
Insecure bool `koanf:"ignoressl" enum:"true,false" json:"ignoressl,omitempty" default:"false"`
}
type StartupCheck ¶ added in v0.4.0
type Status ¶ added in v0.4.0
type Status struct {
Health string `json:"health" example:"ok" doc:"Overall health of Frigate-Notify app"`
API string `json:"api" example:"v0.0.0" doc:"Health of Frigate-Notify API"`
Frigate FrigateConnection `json:"frigate"`
LastEvent time.Time `json:"last_event" example:"0001-01-01T00:00:00Z" doc:"Timestamp of last received event from Frigate"`
LastNotification time.Time `json:"last_notification" example:"0001-01-01T00:00:00Z" doc:"Timestamp of last sent notification"`
Notifications Notifiers `json:"notifications" doc:"Status of notification providers"`
Monitor string `json:"monitor" example:"ok" doc:"Health of reporting state to external health monitor app"`
}
type Telegram ¶ added in v0.4.0
type Telegram struct {
AlertCommon `koanf:",squash"`
ChatID int64 `koanf:"chatid" json:"chatid,omitempty" doc:"Telegram chat ID" default:"0"`
MessageThreadID int `koanf:"message_thread_id" json:"message_thread_id,omitempty" doc:"Send message to thread by ID" default:"0"`
Token string `koanf:"token" json:"token,omitempty" doc:"Telegram bot token" default:""`
SendClip bool `koanf:"send_clip" json:"send_clip,omitempty" doc:"Send event video clip instead of snapshot image" default:"false"`
}
type WebAPI ¶ added in v0.4.0
type WebAPI struct {
Enabled bool `koanf:"enabled" json:"enabled" enum:"true,false" doc:"Enable event collection via Frigate API" default:"false"`
Interval int `` /* 135-byte string literal not displayed */
TestMode bool `koanf:"testmode" json:"testmode,omitempty" enum:"true,false" doc:"Used for testing only" hidden:"true" default:"false"`
}
type Webhook ¶ added in v0.4.0
type Webhook struct {
AlertCommon `koanf:",squash"`
Server string `koanf:"server" json:"server,omitempty" doc:"Webhook address" default:""`
Insecure bool `koanf:"ignoressl" json:"insecure,omitempty" doc:"Ignore TLS/SSL errors" default:"false"`
Method string `koanf:"method" json:"method,omitempty" enum:"GET,POST" doc:"HTTP method for webhook notifications" default:"POST"`
Params []map[string]string `fix:"params" json:"params,omitempty" doc:"URL parameters for webhook notifications"`
Headers []map[string]string `koanf:"headers" json:"headers,omitempty" doc:"HTTP headers for webhook notifications"`
Template interface{} `koanf:"template" json:"template,omitempty" doc:"Custom message template"`
}
Click to show internal directories.
Click to hide internal directories.