config

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(configFile string)

loadConfig opens & attempts to parse configuration file

Types

type Alerts

type Alerts struct {
	General   General  `fig:"general"`
	Quiet     Quiet    `fig:"quiet"`
	Zones     Zones    `fig:"zones"`
	Labels    Labels   `fig:"labels"`
	SubLabels Labels   `fig:"sublabels"`
	Discord   Discord  `fig:"discord"`
	Gotify    Gotify   `fig:"gotify"`
	SMTP      SMTP     `fig:"smtp"`
	Telegram  Telegram `fig:"telegram"`
	Pushover  Pushover `fig:"pushover"`
	Nfty      Nfty     `fig:"nfty"`
	Ntfy      Ntfy     `fig:"ntfy"`
	Webhook   Webhook  `fig:"webhook"`
}

type Cameras

type Cameras struct {
	Exclude []string `fig:"exclude" default:[]`
}

type Config

type Config struct {
	Frigate *Frigate `fig:"frigate" validate:"required"`
	Alerts  *Alerts  `fig:"alerts" validate:"required"`
	Monitor Monitor  `fig:"monitor"`
}
var ConfigData Config

type Discord

type Discord struct {
	Enabled  bool   `fig:"enabled" default:false`
	Webhook  string `fig:"webhook" default:""`
	Template string `fig:"template" default:""`
}

type Frigate

type Frigate struct {
	Server       string              `fig:"server" validate:"required"`
	Insecure     bool                `fig:"ignoressl" default:false`
	PublicURL    string              `fig:"public_url" default:""`
	Headers      []map[string]string `fig:"headers"`
	StartupCheck StartupCheck        `fig:"startup_check"`
	WebAPI       WebAPI              `fig:"webapi"`
	MQTT         MQTT                `fig:"mqtt"`
	Cameras      Cameras             `fig:"cameras"`
	Version      int                 // Internal use only
}

type General

type General struct {
	Title         string `fig:"title" default:"Frigate Alert"`
	TimeFormat    string `fig:"timeformat" default:""`
	NoSnap        string `fig:"nosnap" default:"allow"`
	SnapBbox      bool   `fig:"snap_bbox" default:false`
	SnapTimestamp bool   `fig:"snap_timestamp" default:false`
	SnapCrop      bool   `fig:"snap_crop" default:false`
	NotifyOnce    bool   `fig:"notify_once" default:false`
}

type Gotify

type Gotify struct {
	Enabled  bool   `fig:"enabled" default:false`
	Server   string `fig:"server" default:""`
	Token    string `fig:"token" default:""`
	Insecure bool   `fig:"ignoressl" default:false`
	Template string `fig:"template" default:""`
}

type Labels added in v0.2.7

type Labels struct {
	MinScore float64  `fig:"min_score" default:0`
	Allow    []string `fig:"allow" default:[]`
	Block    []string `fig:"block" default:[]`
}

type MQTT

type MQTT struct {
	Enabled     bool   `fig:"enabled" default:false`
	Server      string `fig:"server" default:""`
	Port        int    `fig:"port" default:1883`
	ClientID    string `fig:"clientid" default:"frigate-notify"`
	Username    string `fig:"username" default:""`
	Password    string `fig:"password" default:""`
	TopicPrefix string `fig:"topic_prefix" default:"frigate"`
}

type Monitor

type Monitor struct {
	Enabled  bool   `fig:"enabled" default:false`
	URL      string `fig:"url" default:""`
	Interval int    `fig:"interval" default:60`
	Insecure bool   `fig:"ignoressl" default:false`
}

type Nfty added in v0.2.8

type Nfty struct {
	Enabled  bool                `fig:"enabled" default:false`
	Server   string              `fig:"server" default:""`
	Topic    string              `fig:"topic" default:""`
	Insecure bool                `fig:"ignoressl" default:false`
	Headers  []map[string]string `fig:"headers"`
	Template string              `fig:"template" default:""`
}

DEPRECATED: Misspelling of Ntfy

type Ntfy added in v0.3.1

type Ntfy struct {
	Enabled  bool                `fig:"enabled" default:false`
	Server   string              `fig:"server" default:""`
	Topic    string              `fig:"topic" default:""`
	Insecure bool                `fig:"ignoressl" default:false`
	Headers  []map[string]string `fig:"headers" default:[]`
	Template string              `fig:"template" default:""`
}

type Pushover added in v0.2.5

type Pushover struct {
	Enabled  bool   `fig:"enabled" default:false`
	Token    string `fig:"token" default:""`
	Userkey  string `fig:"userkey" default:""`
	Devices  string `fig:"devices" default:""`
	Priority int    `fig:"priority" default:0`
	Retry    int    `fig:"retry" default:0`
	Expire   int    `fig:"expire" default:0`
	TTL      int    `fig:"ttl" default:0`
	Template string `fig:"template" default:""`
}

type Quiet added in v0.3.3

type Quiet struct {
	Start string `fig:"start" default:""`
	End   string `fig:"end" default:""`
}

type SMTP

type SMTP struct {
	Enabled   bool   `fig:"enabled" default:false`
	Server    string `fig:"server" default:""`
	Port      int    `fig:"port" default:25`
	TLS       bool   `fig:"tls" default:false`
	User      string `fig:"user" default:""`
	Password  string `fig:"password" default:""`
	From      string `fig:"from" default:""`
	Recipient string `fig:"recipient" default:""`
	Template  string `fig:"template" default:""`
	Insecure  bool   `fig:"ignoressl" default:false`
}

type StartupCheck added in v0.3.0

type StartupCheck struct {
	Attempts int `fig:"attempts" default:5`
	Interval int `fig:"interval" default:30`
}

type Telegram added in v0.2.4

type Telegram struct {
	Enabled  bool   `fig:"enabled" default:false`
	ChatID   int64  `fig:"chatid" default:0`
	Token    string `fig:"token" default:""`
	Template string `fig:"template" default:""`
}

type WebAPI

type WebAPI struct {
	Enabled  bool `fig:"enabled" default:false`
	Interval int  `fig:"interval" default:30`
	TestMode bool `fig:"testmode" default:false`
}

type Webhook added in v0.3.0

type Webhook struct {
	Enabled  bool                   `fig:"enabled" default:false`
	Server   string                 `fig:"server" default:""`
	Insecure bool                   `fig:"ignoressl" default:false`
	Method   string                 `fig:"method" default:"POST"`
	Params   []map[string]string    `fix:"params"`
	Headers  []map[string]string    `fig:"headers"`
	Template map[string]interface{} `fig:"template"`
}

type Zones

type Zones struct {
	Unzoned string   `fig:"unzoned" default:"allow"`
	Allow   []string `fig:"allow" default:[]`
	Block   []string `fig:"block" default:[]`
}

Jump to

Keyboard shortcuts

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