Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultNotificationFormats = NotificationFormats{ ConfigReloaded: NotificationFormat{ Enabled: ptr.Ref(true), Title: "config reloaded", Message: "", Priority: 10, }, LoginFailed: NotificationFormat{ Enabled: ptr.Ref(true), Title: "login failed", Message: "{{ .Error }}", Priority: 10, }, Panicked: NotificationFormat{ Enabled: ptr.Ref(true), Title: "panicked", Message: "{{ .Capture }}", Priority: 10, }, Idle: NotificationFormat{ Enabled: ptr.Ref(false), Title: "watching {{ .ChannelID }}", }, PreparingFiles: NotificationFormat{ Enabled: ptr.Ref(false), Title: "preparing files for {{ .MetaData.ProfileData.Name }}", }, Downloading: NotificationFormat{ Enabled: ptr.Ref(true), Title: "{{ .MetaData.ProfileData.Name }} is streaming", Message: "{{ .MetaData.ChannelData.Title }}", Priority: 7, }, PostProcessing: NotificationFormat{ Enabled: ptr.Ref(false), Title: "post-processing {{ .MetaData.ProfileData.Name }}", Message: "{{ .MetaData.ChannelData.Title }}", Priority: 7, }, Finished: NotificationFormat{ Enabled: ptr.Ref(true), Title: "{{ .MetaData.ProfileData.Name }} stream ended", Message: "{{ .MetaData.ChannelData.Title }}", Priority: 7, }, Error: NotificationFormat{ Enabled: ptr.Ref(true), Title: "stream download of {{ .ChannelID }} failed", Message: "{{ .Error }}", Priority: 10, }, Canceled: NotificationFormat{ Enabled: ptr.Ref(true), Title: "stream download of {{ .ChannelID }} canceled", Priority: 10, }, }
Functions ¶
This section is empty.
Types ¶
type BaseNotifier ¶ added in v1.2.0
type BaseNotifier interface { Notify( ctx context.Context, title string, message string, priority int, ) error }
func NewDummyNotifier ¶
func NewDummyNotifier() BaseNotifier
func NewShoutrrr ¶ added in v1.2.0
func NewShoutrrr(urls []string, opts ...ShoutrrrOption) BaseNotifier
type FormatedNotifier ¶ added in v1.2.0
type FormatedNotifier interface { BaseNotifier NotifyConfigReloaded(ctx context.Context) error NotifyLoginFailed(ctx context.Context, capture error) error NotifyPanicked(ctx context.Context, capture any) error NotifyIdle(ctx context.Context, channelID string, labels map[string]string) error NotifyPreparingFiles( ctx context.Context, channelID string, labels map[string]string, metadata any, ) error NotifyDownloading( ctx context.Context, channelID string, labels map[string]string, metadata any, ) error NotifyPostProcessing( ctx context.Context, channelID string, labels map[string]string, metadata any, ) error NotifyFinished( ctx context.Context, channelID string, labels map[string]string, metadata any, ) error NotifyError( ctx context.Context, channelID string, labels map[string]string, err error, ) error NotifyCanceled( ctx context.Context, channelID string, labels map[string]string, ) error }
func NewFormatedNotifier ¶ added in v1.2.0
func NewFormatedNotifier(notifier BaseNotifier, formats NotificationFormats) FormatedNotifier
type NotificationFormat ¶ added in v1.2.0
type NotificationFormats ¶ added in v1.2.0
type NotificationFormats struct { ConfigReloaded NotificationFormat `yaml:"configReloaded,omitempty"` LoginFailed NotificationFormat `yaml:"loginFailed,omitempty"` Panicked NotificationFormat `yaml:"panicked,omitempty"` Idle NotificationFormat `yaml:"idle,omitempty"` PreparingFiles NotificationFormat `yaml:"preparingFiles,omitempty"` Downloading NotificationFormat `yaml:"downloading,omitempty"` PostProcessing NotificationFormat `yaml:"postProcessing,omitempty"` Finished NotificationFormat `yaml:"finished,omitempty"` Error NotificationFormat `yaml:"error,omitempty"` Canceled NotificationFormat `yaml:"canceled,omitempty"` }
type NotificationTemplate ¶ added in v1.2.0
type NotificationTemplates ¶ added in v1.2.0
type NotificationTemplates struct { ConfigReloaded NotificationTemplate LoginFailed NotificationTemplate Panicked NotificationTemplate Idle NotificationTemplate PreparingFiles NotificationTemplate Downloading NotificationTemplate PostProcessing NotificationTemplate Finished NotificationTemplate Error NotificationTemplate Canceled NotificationTemplate }
type Shoutrrr ¶ added in v1.2.0
type Shoutrrr struct { *router.ServiceRouter // contains filtered or unexported fields }
type ShoutrrrOption ¶ added in v1.2.0
type ShoutrrrOption func(*ShoutrrrOptions)
func IncludeTitleInMessage ¶ added in v1.2.0
func IncludeTitleInMessage(value ...bool) ShoutrrrOption
func NoPriority ¶ added in v1.4.1
func NoPriority(value ...bool) ShoutrrrOption
type ShoutrrrOptions ¶ added in v1.2.0
type ShoutrrrOptions struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.