1
0
mirror of https://github.com/nikoksr/notify.git synced 2024-12-14 10:23:19 +02:00
notify/use.go

17 lines
390 B
Go
Raw Normal View History

2021-01-25 01:14:21 +02:00
package notify
// useService adds a given service to the Notifier's services list.
func (n *Notify) useService(service Notifier) {
2021-01-25 01:14:21 +02:00
if service == nil {
return
}
n.notifiers = append(n.notifiers, service)
2021-01-25 01:14:21 +02:00
}
// UseServices adds the given service(s) to the Notifier's services list.
func (n *Notify) UseServices(service ...Notifier) {
for _, s := range service {
n.useService(s)
}
2021-01-25 01:14:21 +02:00
}