mirror of
https://github.com/yusing/godoxy.git
synced 2026-01-11 21:10:30 +01:00
fix(gotify): error if token not present
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/bytedance/sonic"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/rs/zerolog"
|
||||
gperr "github.com/yusing/goutils/errs"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -18,6 +19,16 @@ type (
|
||||
|
||||
const gotifyMsgEndpoint = "/message"
|
||||
|
||||
func (client *GotifyClient) Validate() gperr.Error {
|
||||
if err := client.ProviderBase.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
if client.Token == "" {
|
||||
return gperr.New("token is required")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (client *GotifyClient) GetURL() string {
|
||||
return client.URL + gotifyMsgEndpoint
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user