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/repositories/phone_api_key_repository.go from red-kit/httpsms-gateway: direct link, hf CLI and curl.
- Browser
- Download file 1.67 kB
-
https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/main/api/pkg/repositories/phone_api_key_repository.go
- Command line
-
hf download hf://spaces/red-kit/httpsms-gateway/api/pkg/repositories/phone_api_key_repository.go
-
curl -L -o phone_api_key_repository.go https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/main/api/pkg/repositories/phone_api_key_repository.go
1.67 kB
| package repositories | |
| import ( | |
| "context" | |
| "github.com/google/uuid" | |
| "github.com/NdoleStudio/httpsms/pkg/entities" | |
| ) | |
| // PhoneAPIKeyRepository loads and persists an entities.PhoneAPIKey | |
| type PhoneAPIKeyRepository interface { | |
| // Create a new entities.PhoneAPIKey | |
| Create(ctx context.Context, phone *entities.PhoneAPIKey) error | |
| // Load an entities.PhoneAPIKey by userID and phoneAPIKeyID | |
| Load(ctx context.Context, userID entities.UserID, phoneAPIKeyID uuid.UUID) (*entities.PhoneAPIKey, error) | |
| // LoadAuthContext fetches an entities.AuthContext by apiKey | |
| LoadAuthContext(ctx context.Context, apiKey string) (entities.AuthContext, error) | |
| // Index entities.PhoneAPIKey of a user | |
| Index(ctx context.Context, userID entities.UserID, params IndexParams) ([]*entities.PhoneAPIKey, error) | |
| // Delete an entities.PhoneAPIKey | |
| Delete(ctx context.Context, phoneAPIKey *entities.PhoneAPIKey) error | |
| // AddPhone adds an entities.Phone to an entities.PhoneAPIKey | |
| AddPhone(ctx context.Context, phoneAPIKey *entities.PhoneAPIKey, phone *entities.Phone) error | |
| // RemovePhone removes an entities.Phone to an entities.PhoneAPIKey | |
| RemovePhone(ctx context.Context, phoneAPIKey *entities.PhoneAPIKey, phone *entities.Phone) error | |
| // CountByUser returns the number of phone API keys owned by a user | |
| CountByUser(ctx context.Context, userID entities.UserID) (int, error) | |
| // DeleteAllForUser deletes all entities.PhoneAPIKey for a user | |
| DeleteAllForUser(ctx context.Context, userID entities.UserID) error | |
| // RemovePhoneByID removes a phone by ID and phone number | |
| RemovePhoneByID(ctx context.Context, userID entities.UserID, phoneID uuid.UUID, phoneNumber string) error | |
| } | |