Deletion of notification services.

This commit is contained in:
Magnus Åhall 2024-06-28 17:18:08 +02:00
parent c7ad2aa1b6
commit a736ae60af
10 changed files with 74 additions and 9 deletions

View file

@ -37,6 +37,16 @@ func ServiceFactory(t string, config []byte, prio int, ackURL string, logger *sl
return nil, werr.New("Unknown notification service, '%s'", t).WithCode("002-0000")
}
func NewInstance(typ string) Service {
switch typ {
case "NTFY":
return new(NTFY)
case "SCRIPT":
return new(Script)
}
return nil
}
func GetInstance(typ string) Service {
for _, svc := range allServices {
if strings.ToLower(svc.GetType()) == strings.ToLower(typ) {