Documentation ¶
Overview ¶
Package notifiers contains notifier implementations and a notifier registry.
Built-in supported notifiers are housed here. These notifiers can be used by the monitor to send Github Status change notifications to external systems.
Index ¶
- Constants
- func GetNotifier(log *zap.Logger, name string) (notifier.Notifier, error)
- func ListNotifiers() []string
- func NewFileNotifier(_ *zap.Logger) (notifier.Notifier, error)
- func NewSlackNotifier(log *zap.Logger) (notifier.Notifier, error)
- func NewStdoutNotifier(_ *zap.Logger) (notifier.Notifier, error)
- func RegisterCommandFlags(cmd *cobra.Command)
- func RegisterNotifier(name string, creator NotifierCreator) error
- type FileNotifier
- type NotifierCreator
- type SlackNotifier
- type StdoutNotifier
- type WriterNotifier
Constants ¶
const (
File = "file"
)
const (
Slack = "slack"
)
const (
Stdout = "stdout"
)
Variables ¶
This section is empty.
Functions ¶
func GetNotifier ¶
GetNotifier will retrieve the notifier with the given name.
func NewFileNotifier ¶
NewFileNotifier will return a file notifier.
func NewSlackNotifier ¶
NewSlackNotifier will return a Slack notifier.
func NewStdoutNotifier ¶
NewStdoutNotifier will return an stdout notifier.
func RegisterCommandFlags ¶
RegisterCommandFlags will register CLI flags for all commands with the given command.
func RegisterNotifier ¶
func RegisterNotifier(name string, creator NotifierCreator) error
RegisterNotifier will register the given notifier and the given notifier creation function.
Types ¶
type FileNotifier ¶
type FileNotifier struct { *WriterNotifier // contains filtered or unexported fields }
FileNotifier writes the output to the given file.
func (*FileNotifier) Cleanup ¶
func (f *FileNotifier) Cleanup() error
Cleanup performs any cleanup steps.
type NotifierCreator ¶
NotifierCreator creates a notifier.
type SlackNotifier ¶
type SlackNotifier struct {
// contains filtered or unexported fields
}
SlackNotifier writes the output to Slack.
func (*SlackNotifier) Cleanup ¶
func (s *SlackNotifier) Cleanup() error
Cleanup performs any cleanup steps.
type StdoutNotifier ¶
type StdoutNotifier struct {
*WriterNotifier
}
StdoutNotifier writes the output to stdout.
func (*StdoutNotifier) Name ¶
func (*StdoutNotifier) Name() string
Name is the name of the notifier.
type WriterNotifier ¶
type WriterNotifier struct {
// contains filtered or unexported fields
}
WriterNotifier writes the output to the given io.Writer. This is meant to be used by other notifiers and not directly, so it is not registered with the notifier registry.
func NewWriterNotifier ¶
func NewWriterNotifier(writer io.Writer) *WriterNotifier
NewWriterNotifier will return a writer notifier.
func (*WriterNotifier) Cleanup ¶
func (w *WriterNotifier) Cleanup() error
Cleanup performs any cleanup steps.
func (*WriterNotifier) Name ¶
func (*WriterNotifier) Name() string
Name is the name of the notifier.