add new feature
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user