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/responses/response.go from red-kit/httpsms-gateway: direct link, hf CLI and curl.
- Browser
- Download file 2.34 kB
-
https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/6917738ca6db1603dee9e07994b4e42d5e1ae9b2/api/pkg/responses/response.go
- Command line
-
hf download hf://spaces/red-kit/httpsms-gateway@6917738ca6db1603dee9e07994b4e42d5e1ae9b2/api/pkg/responses/response.go
-
curl -L -o response.go https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/6917738ca6db1603dee9e07994b4e42d5e1ae9b2/api/pkg/responses/response.go
2.34 kB
| package responses | |
| type response struct { | |
| Status string `json:"status" example:"success"` | |
| Message string `json:"message" example:"Request handled successfully"` | |
| } | |
| // InternalServerError is the response with status code is 500 | |
| type InternalServerError struct { | |
| Status string `json:"status" example:"error"` | |
| Message string `json:"message" example:"We ran into an internal error while handling the request."` | |
| } | |
| // NotFound is the response with status code is 404 | |
| type NotFound struct { | |
| Status string `json:"status" example:"error"` | |
| Message string `json:"message" example:"cannot find message with ID [32343a19-da5e-4b1b-a767-3298a73703ca]"` | |
| } | |
| // BadRequest is the response with status code is 400 | |
| type BadRequest struct { | |
| Status string `json:"status" example:"error"` | |
| Message string `json:"message" example:"The request isn't properly formed"` | |
| Data string `json:"data" example:"The request body is not a valid JSON string"` | |
| } | |
| // UnprocessableEntity is the response with status code is 422 | |
| type UnprocessableEntity struct { | |
| Status string `json:"status" example:"error"` | |
| Message string `json:"message" example:"validation errors while handling request"` | |
| Data map[string][]string `json:"data"` | |
| } | |
| // Unauthorized is the response with status code is 403 | |
| type Unauthorized struct { | |
| Status string `json:"status" example:"error"` | |
| Message string `json:"message" example:"You are not authorized to carry out this request."` | |
| Data string `json:"data" example:"Make sure your API key is set in the [X-API-Key] header in the request"` | |
| } | |
| // PaymentRequired is the response with status code is 402 | |
| type PaymentRequired struct { | |
| Status string `json:"status" example:"error"` | |
| Message string `json:"message" example:"You have reached the maximum number of allowed resources. Please upgrade your plan."` | |
| } | |
| // NoContent is the response when status code is 204 | |
| type NoContent struct { | |
| Status string `json:"status" example:"success"` | |
| Message string `json:"message" example:"action performed successfully"` | |
| } | |
| // Ok is the response with status code is 200 | |
| type Ok[T any] struct { | |
| Status string `json:"status" example:"success"` | |
| Message string `json:"message" example:"Request handled successfully"` | |
| Data T `json:"data"` | |
| } | |
| // OkString returns a string response | |
| type OkString Ok[string] | |