mirror of
https://github.com/fluxcd/flagger.git
synced 2026-03-02 09:40:52 +00:00
27 lines
478 B
Go
27 lines
478 B
Go
package notifier
|
|
|
|
type Factory struct {
|
|
URL string
|
|
Username string
|
|
Channel string
|
|
}
|
|
|
|
func NewFactory(URL string, username string, channel string) *Factory {
|
|
return &Factory{
|
|
URL: URL,
|
|
Channel: channel,
|
|
Username: username,
|
|
}
|
|
}
|
|
|
|
func (f Factory) Notifier(provider string) (Interface, error) {
|
|
switch {
|
|
case provider == "slack":
|
|
return NewSlack(f.URL, f.Username, f.Channel)
|
|
case provider == "msteams":
|
|
return NewMSTeams(f.URL)
|
|
}
|
|
|
|
return nil, nil
|
|
}
|