Field Client.cfg deleted. Field Client.sendEndpoint added.
This commit is contained in:
parent
65928f4c0b
commit
250cfe9d33
6
fcm.go
6
fcm.go
|
@ -84,7 +84,7 @@ type ClientConfig struct {
|
|||
}
|
||||
|
||||
type Client struct {
|
||||
cfg ClientConfig
|
||||
sendEndpoint string
|
||||
ts oauth2.TokenSource
|
||||
hc *http.Client
|
||||
logger logr.Logger
|
||||
|
@ -92,7 +92,7 @@ type Client struct {
|
|||
|
||||
func NewClient(projectId string, cfg ClientConfig, ts oauth2.TokenSource, hc *http.Client, logger logr.Logger) *Client {
|
||||
return &Client{
|
||||
cfg: cfg,
|
||||
sendEndpoint: cfg.SendEndpoint,
|
||||
ts: ts,
|
||||
hc: hc,
|
||||
logger: logger,
|
||||
|
@ -194,7 +194,7 @@ func (c *Client) doSendRequest(ctx context.Context, req SendRequest, loggerEnabl
|
|||
c.logger.Info("sending", "message", data)
|
||||
}
|
||||
|
||||
request, err := http.NewRequest(http.MethodPost, c.cfg.SendEndpoint, bytes.NewReader(data))
|
||||
request, err := http.NewRequest(http.MethodPost, c.sendEndpoint, bytes.NewReader(data))
|
||||
if err != nil {
|
||||
span.SetStatus(codes.Error, err.Error())
|
||||
span.RecordError(err)
|
||||
|
|
Loading…
Reference in New Issue