Documentation
¶
Index ¶
- func GetAvatarFromMultipartForm(r *http.Request) (*models.File, error)
- func GetRequestBody[T any](r *http.Request) (*T, error)
- func GetScanFromMultipartForm(r *http.Request) (*models.File, error)
- type AuthRequest
- type AuthResponse
- type ChangePasswordRequest
- type HTTPResource
- type LoginUserRequest
- type PredictionResponse
- type UploadAvatarRequest
- type UploadAvatarResponse
- type UserResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthRequest ¶
type AuthResponse ¶
type AuthResponse struct {
User struct {
ID string `json:"id"`
Login string `json:"login"`
} `json:"user"`
}
func NewAuthResponse ¶
func NewAuthResponse(user models.User, access, refresh string) AuthResponse
type ChangePasswordRequest ¶
type HTTPResource ¶
type HTTPResource interface {
LoginUserRequest | ChangePasswordRequest
}
type LoginUserRequest ¶
type LoginUserRequest struct {
Login string `json:"login" validate:"required,min=3,max=32,alphanum"`
Password string `json:"password" validate:"required,min=8,max=64"`
Name string `json:"name,omitempty" validate:"omitempty,min=3,max=64,alphanum"`
}
func (*LoginUserRequest) ToModel ¶
func (r *LoginUserRequest) ToModel() models.User
type PredictionResponse ¶
type PredictionResponse models.Prediction
type UploadAvatarRequest ¶
type UploadAvatarRequest struct {
Avatar string `json:"avatar" swaggertype:"string" format:"binary" example:"avatar.jpg" validate:"required"`
}
type UploadAvatarResponse ¶
type UploadAvatarResponse struct {
AvatarURL string `json:"avatar_url" example:"http://localhost:9000/trashscanner-images/user-id/avatars/avatar.jpg"`
}
type UserResponse ¶
Click to show internal directories.
Click to hide internal directories.