feat: port lab4 implementation

This commit is contained in:
kk10
2026-11-13 15:52:39 +03:00
parent 276dbdad8a
commit 36d9b0c8f6
101 changed files with 8426 additions and 6 deletions
+25
View File
@@ -0,0 +1,25 @@
package dto
type ErrorCode string
const (
ErrorCodeInvalidRequest ErrorCode = "invalid_request"
ErrorCodeUnauthorized ErrorCode = "unauthorized"
ErrorCodeNotFound ErrorCode = "not_found"
ErrorCodeConflict ErrorCode = "conflict"
ErrorCodePayloadTooLarge ErrorCode = "payload_too_large"
ErrorCodeUnsupportedMediaType ErrorCode = "unsupported_media_type"
ErrorCodeRateLimited ErrorCode = "rate_limited"
ErrorCodeUnavailable ErrorCode = "unavailable"
ErrorCodeInternalError ErrorCode = "internal_error"
)
type ErrorResponse struct {
Error Error `json:"error"`
}
type Error struct {
Code ErrorCode `json:"code"`
Message string `json:"message"`
RequestID string `json:"request_id"`
}