Field Client.cfg deleted. Field Client.sendEndpoint added.

This commit is contained in:
Владислав Весельский 2025-02-05 11:41:38 +03:00
parent 65928f4c0b
commit 250cfe9d33
1 changed files with 9 additions and 9 deletions

6
fcm.go
View File

@ -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)