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/requests/contact_index.go from red-kit/httpsms-gateway: direct link, hf CLI and curl.
- Browser
- Download file 1.22 kB
-
https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/main/api/pkg/requests/contact_index.go
- Command line
-
hf download hf://spaces/red-kit/httpsms-gateway/api/pkg/requests/contact_index.go
-
curl -L -o contact_index.go https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/main/api/pkg/requests/contact_index.go
1.22 kB
| package requests | |
| import ( | |
| "strings" | |
| "github.com/NdoleStudio/httpsms/pkg/repositories" | |
| ) | |
| // ContactIndex lists contacts for a user. | |
| type ContactIndex struct { | |
| request | |
| Skip string `json:"skip" query:"skip"` | |
| Query string `json:"query" query:"query"` | |
| SortBy string `json:"sort_by" query:"sort_by"` | |
| SortDescending bool `json:"sort_descending" query:"sort_descending"` | |
| Limit string `json:"limit" query:"limit"` | |
| } | |
| // Sanitize sets defaults for the list request. | |
| func (input *ContactIndex) Sanitize() ContactIndex { | |
| input.Query = strings.TrimSpace(input.Query) | |
| input.SortBy = strings.TrimSpace(input.SortBy) | |
| input.Skip = strings.TrimSpace(input.Skip) | |
| input.Limit = strings.TrimSpace(input.Limit) | |
| if input.Skip == "" { | |
| input.Skip = "0" | |
| } | |
| if input.Limit == "" { | |
| input.Limit = "20" | |
| } | |
| return *input | |
| } | |
| // ToIndexParams converts the request into repositories.IndexParams. | |
| func (input *ContactIndex) ToIndexParams() repositories.IndexParams { | |
| return repositories.IndexParams{ | |
| Skip: input.getInt(input.Skip), | |
| Query: input.Query, | |
| SortBy: input.SortBy, | |
| SortDescending: input.SortDescending, | |
| Limit: input.getInt(input.Limit), | |
| } | |
| } | |