/
githubmirror
/
photoprism
Обзор
Документация
Войти
/
githubmirror
/
photoprism
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
internal/api/api_response.go
19 строк
537 B
Michael Mayer
Auth: Use hashed auth tokens for enhanced security #3943 #808 #782
06 янв 2024, 19:35
06 янв 2024, 19:35
0d2f8be
Код
Авторство
О чём код?
package api import "net/http" // Response represents a server status response. type Response struct { Code int `json:"code"` Err string `json:"error,omitempty"` Msg string `json:"message,omitempty"` Details string `json:"details,omitempty"` } // NewResponse creates a new server status response. func NewResponse(code int, err error, details string) Response { if err == nil { return Response{Code: http.StatusOK, Msg: "OK", Details: details} } return Response{Code: code, Err: err.Error(), Details: details} }