Documentation ¶
Index ¶
- func LogInit(log *util.JLog)
- type Shoutrrr
- func (s *Shoutrrr) BuildParams(context *util.ServiceInfo) (params *shoutrrr_types.Params)
- func (s *Shoutrrr) BuildURL() (url string)
- func (s *Shoutrrr) CheckValues(prefix string) (errs error)
- func (s *Shoutrrr) GetDelay() string
- func (s *Shoutrrr) GetDelayDuration() (duration time.Duration)
- func (s *Shoutrrr) GetMaxTries() uint
- func (s *Shoutrrr) GetOption(key string) string
- func (s *Shoutrrr) GetParam(key string) string
- func (s *Shoutrrr) GetType() string
- func (s *Shoutrrr) GetURLField(key string) string
- func (s *Shoutrrr) Init(serviceStatus *svcstatus.Status, main *ShoutrrrDefaults, ...)
- func (s *Shoutrrr) InitMaps()
- func (s *Shoutrrr) Message(context *util.ServiceInfo) string
- func (s *Shoutrrr) Send(title string, message string, serviceInfo *util.ServiceInfo, useDelay bool) (errs error)
- func (s *Shoutrrr) String(prefix string) (str string)
- func (s *Shoutrrr) Title(serviceInfo *util.ServiceInfo) string
- type ShoutrrrBase
- func (s *ShoutrrrBase) CheckValues(prefix string) (errs error)
- func (s *ShoutrrrBase) GetOption(key string) string
- func (s *ShoutrrrBase) GetParam(key string) string
- func (s *ShoutrrrBase) GetURLField(key string) string
- func (s *ShoutrrrBase) Init()
- func (s *ShoutrrrBase) InitMaps()
- func (s *ShoutrrrBase) SetOption(key string, value string)
- func (s *ShoutrrrBase) SetParam(key string, value string)
- func (s *ShoutrrrBase) SetURLField(key string, value string)
- type ShoutrrrDefaults
- type Slice
- func (s *Slice) CheckValues(prefix string) (errs error)
- func (s *Slice) DeleteMetrics()
- func (s *Slice) Init(serviceStatus *svcstatus.Status, mains *SliceDefaults, defaults *SliceDefaults, ...)
- func (s *Slice) InitMetrics()
- func (s *Slice) Send(title string, message string, serviceInfo *util.ServiceInfo, useDelay bool) (errs error)
- func (s *Slice) String(prefix string) (str string)
- type SliceDefaults
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Shoutrrr ¶
type Shoutrrr struct { ShoutrrrBase `yaml:",inline" json:",inline"` ID string `yaml:"-" json:"-"` // ID for this Shoutrrr sender Failed *svcstatus.FailsShoutrrr `yaml:"-" json:"-"` // Whether the last send attempt failed ServiceStatus *svcstatus.Status `yaml:"-" json:"-"` // Status of the Service (used for templating commands) Main *ShoutrrrDefaults `yaml:"-" json:"-"` // The Shoutrrr that this Shoutrrr is calling (and may override parts of) Defaults *ShoutrrrDefaults `yaml:"-" json:"-"` // Default values HardDefaults *ShoutrrrDefaults `yaml:"-" json:"-"` // Harcoded default values }
func New ¶
func New( failed *svcstatus.FailsShoutrrr, id string, options *map[string]string, params *map[string]string, sType string, urlFields *map[string]string, main *ShoutrrrDefaults, defaults *ShoutrrrDefaults, hardDefaults *ShoutrrrDefaults, ) (shoutrrr *Shoutrrr)
New Shoutrrr.
func (*Shoutrrr) BuildParams ¶
func (s *Shoutrrr) BuildParams(context *util.ServiceInfo) (params *shoutrrr_types.Params)
BuildParams returns the params using everything from master>main>defaults>hardDefaults when the key is not defined in the lower level
func (*Shoutrrr) CheckValues ¶
CheckValues of this Notification.
func (*Shoutrrr) GetDelayDuration ¶
GetDelayDuration before sending.
func (*Shoutrrr) GetMaxTries ¶
GetMaxTries allowed for the Gotification.
func (*Shoutrrr) GetURLField ¶
GetURLField from this/Main/Defaults/HardDefaults on FiFo
func (*Shoutrrr) Init ¶
func (s *Shoutrrr) Init( serviceStatus *svcstatus.Status, main *ShoutrrrDefaults, defaults *ShoutrrrDefaults, hardDefaults *ShoutrrrDefaults, )
Init the Shoutrrr metrics and hand out the defaults.
func (*Shoutrrr) InitMaps ¶
func (s *Shoutrrr) InitMaps()
InitMaps will initialise all maps, converting all keys to lowercase.
func (*Shoutrrr) Message ¶
func (s *Shoutrrr) Message(context *util.ServiceInfo) string
Message of the Shoutrrr after the context is applied and template evaluated.
type ShoutrrrBase ¶
type ShoutrrrBase struct { Type string `yaml:"type,omitempty" json:"type,omitempty"` // Notification type, e.g. slack Options map[string]string `yaml:"options,omitempty" json:"options,omitempty"` // Options URLFields map[string]string `yaml:"url_fields,omitempty" json:"url_fields,omitempty"` // URL Fields Params map[string]string `yaml:"params,omitempty" json:"params,omitempty"` // Query/Param Props }
ShoutrrrBase is the base Shoutrrr.
func (*ShoutrrrBase) CheckValues ¶
func (s *ShoutrrrBase) CheckValues(prefix string) (errs error)
CheckValues of this Notification.
func (*ShoutrrrBase) GetOption ¶
func (s *ShoutrrrBase) GetOption(key string) string
GetOption gets Options[key] from this Shoutrrr
func (*ShoutrrrBase) GetParam ¶
func (s *ShoutrrrBase) GetParam(key string) string
GetParam gets Params[key] from this Shoutrrr
func (*ShoutrrrBase) GetURLField ¶
func (s *ShoutrrrBase) GetURLField(key string) string
GetURLField gets URLFields[key] from this Shoutrrr
func (*ShoutrrrBase) InitMaps ¶
func (s *ShoutrrrBase) InitMaps()
InitMaps will initialise all maps, converting all keys to lowercase.
func (*ShoutrrrBase) SetOption ¶
func (s *ShoutrrrBase) SetOption(key string, value string)
SetOption[key] to value
func (*ShoutrrrBase) SetParam ¶
func (s *ShoutrrrBase) SetParam(key string, value string)
SetParam[key] to value
func (*ShoutrrrBase) SetURLField ¶
func (s *ShoutrrrBase) SetURLField(key string, value string)
SetURLField[key] to value
type ShoutrrrDefaults ¶
type ShoutrrrDefaults struct {
ShoutrrrBase `yaml:",inline" json:",inline"`
}
ShoutrrrDefaults are the default values for Shoutrrr.
func NewDefaults ¶
func NewDefaults( sType string, options *map[string]string, params *map[string]string, urlFields *map[string]string, ) (defaults *ShoutrrrDefaults)
NewDefaults returns a new ShoutrrrDefaults.
func (*ShoutrrrDefaults) String ¶
func (s *ShoutrrrDefaults) String(prefix string) (str string)
String returns a string representation of the ShoutrrrDefaults.
type Slice ¶
Slice mapping of Shoutrrr.
func (*Slice) CheckValues ¶
CheckValues of this Slice.
func (*Slice) Init ¶
func (s *Slice) Init( serviceStatus *svcstatus.Status, mains *SliceDefaults, defaults *SliceDefaults, hardDefaults *SliceDefaults, )
Init the Slice metrics amd hand out the defaults.
type SliceDefaults ¶
type SliceDefaults map[string]*ShoutrrrDefaults
SliceDefaults mapping of ShoutrrrDefaults.
func (*SliceDefaults) CheckValues ¶
func (s *SliceDefaults) CheckValues(prefix string) (errs error)
CheckValues of this SliceDefaults.
func (*SliceDefaults) String ¶
func (s *SliceDefaults) String(prefix string) (str string)
String returns a string representation of the SliceDefaults.