Load loads an alert sender from the registry.
(config Config)
| 134 | |
| 135 | // Load loads an alert sender from the registry. |
| 136 | func Load(config Config) (Sender, error) { |
| 137 | typ := config.Type |
| 138 | factory := factories[typ] |
| 139 | if factory == nil { |
| 140 | return nil, fmt.Errorf("%q alert sender not available in the factory", typ) |
| 141 | } |
| 142 | return factory(config) |
| 143 | } |
| 144 | |
| 145 | // LoadAll loads all alert senders from the configuration inputs. |
| 146 | func LoadAll(configs []Config) error { |
no outgoing calls