Spaces:
Paused
Paused
ML Intern deploy
Deploy httpSMS gateway to Hugging Face Spaces (Docker SDK): nginx :7860 -> Go API :8000, Nuxt SPA, Android APK, bootstrap-mode entrypoint
83a59ca Download api/pkg/services/fcm_client.go from red-kit/httpsms-gateway: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/main/api/pkg/services/fcm_client.go
- Command line
-
hf download hf://spaces/red-kit/httpsms-gateway/api/pkg/services/fcm_client.go
-
curl -L -o fcm_client.go https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/main/api/pkg/services/fcm_client.go
1.03 kB
| package services | |
| import ( | |
| "context" | |
| "firebase.google.com/go/messaging" | |
| "github.com/google/uuid" | |
| ) | |
| // FCMClient sends Firebase-compatible messages through a phone notification transport. | |
| type FCMClient interface { | |
| // Send sends a message and returns the transport's delivery identifier on success. | |
| // phoneID identifies the receiving phone (the notification's target) and is used by HTTP | |
| // adapter transports to sign the request. | |
| Send(ctx context.Context, message *messaging.Message, phoneID uuid.UUID) (string, error) | |
| } | |
| // FirebaseFCMClient wraps the real Firebase messaging.Client. | |
| type FirebaseFCMClient struct { | |
| client *messaging.Client | |
| } | |
| // NewFirebaseFCMClient creates a new FirebaseFCMClient. | |
| func NewFirebaseFCMClient(client *messaging.Client) *FirebaseFCMClient { | |
| return &FirebaseFCMClient{client: client} | |
| } | |
| // Send sends a message via the real Firebase SDK. | |
| func (c *FirebaseFCMClient) Send(ctx context.Context, message *messaging.Message, _ uuid.UUID) (string, error) { | |
| return c.client.Send(ctx, message) | |
| } | |