add new feature

This commit is contained in:
2020-10-22 16:20:18 +08:00
parent f2c7a55eda
commit c9cfb6fd8a
4 changed files with 81 additions and 10 deletions
+10
View File
@@ -2,6 +2,7 @@ package starnotify
import (
"errors"
"time"
"b612.me/notify"
)
@@ -25,6 +26,15 @@ func NewClient(key, netype, value string) (*notify.StarNotifyC, error) {
return client, err
}
func NewClientWithTimeout(key, netype, value string, timeout time.Duration) (*notify.StarNotifyC, error) {
client, err := notify.NewNotifyCWithTimeOut(netype, value, timeout)
if err != nil {
return client, err
}
starClient[key] = client
return client, err
}
func DeleteClient(key string) error {
client, ok := starClient[key]
if !ok {