mirror of
https://github.com/crazy-max/diun.git
synced 2025-12-24 06:28:13 +01:00
Configuration file not required anymore DIUN_DB env var renamed DIUN_DB_PATH Only accept duration as timeout value (10 becomes 10s) Add getting started doc Enhanced documentation Add note about test notifications (#79) Improve configuration management Fix telegram init All fields in configuration now camelCased Improve configuration validation Update doc Update FAQ Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
37 lines
1.3 KiB
Go
37 lines
1.3 KiB
Go
package model
|
|
|
|
import (
|
|
"github.com/crazy-max/diun/v3/pkg/registry"
|
|
)
|
|
|
|
// NotifEntry represents a notification entry
|
|
type NotifEntry struct {
|
|
Status ImageStatus `json:"status,omitempty"`
|
|
Provider string `json:"provider,omitempty"`
|
|
Image registry.Image `json:"image,omitempty"`
|
|
Manifest registry.Manifest `json:"manifest,omitempty"`
|
|
}
|
|
|
|
// Notif holds data necessary for notification configuration
|
|
type Notif struct {
|
|
Amqp *NotifAmqp `yaml:"amqp,omitempty" json:"amqp,omitempty"`
|
|
Gotify *NotifGotify `yaml:"gotify,omitempty" json:"gotify,omitempty"`
|
|
Mail *NotifMail `yaml:"mail,omitempty" json:"mail,omitempty"`
|
|
RocketChat *NotifRocketChat `yaml:"rocketchat,omitempty" json:"rocketchat,omitempty"`
|
|
Script *NotifScript `yaml:"script,omitempty" json:"script,omitempty"`
|
|
Slack *NotifSlack `yaml:"slack,omitempty" json:"slack,omitempty"`
|
|
Teams *NotifTeams `yaml:"teams,omitempty" json:"teams,omitempty"`
|
|
Telegram *NotifTelegram `yaml:"telegram,omitempty" json:"telegram,omitempty"`
|
|
Webhook *NotifWebhook `yaml:"webhook,omitempty" json:"webhook,omitempty"`
|
|
}
|
|
|
|
// GetDefaults gets the default values
|
|
func (s *Notif) GetDefaults() *Notif {
|
|
return nil
|
|
}
|
|
|
|
// SetDefaults sets the default values
|
|
func (s *Notif) SetDefaults() {
|
|
// noop
|
|
}
|