feat: check unused package (#232)
* feat: check unused package update edganiukov/fcm to appleboy/go-fcm * update readme Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * update comment Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
28
vendor/github.com/appleboy/go-fcm/option.go
generated
vendored
Normal file
28
vendor/github.com/appleboy/go-fcm/option.go
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
package fcm
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// Option configurates Client with defined option.
|
||||
type Option func(*Client) error
|
||||
|
||||
// WithEndpoint returns Option to configure FCM Endpoint.
|
||||
func WithEndpoint(endpoint string) Option {
|
||||
return func(c *Client) error {
|
||||
if endpoint == "" {
|
||||
return errors.New("invalid endpoint")
|
||||
}
|
||||
c.endpoint = endpoint
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithHTTPClient returns Option to configure HTTP Client.
|
||||
func WithHTTPClient(httpClient *http.Client) Option {
|
||||
return func(c *Client) error {
|
||||
c.client = httpClient
|
||||
return nil
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user