mirror of
https://github.com/retailcrm/mg-transport-core.git
synced 2024-11-27 23:46:08 +03:00
fix http status helpers
This commit is contained in:
parent
8eb0d6b31f
commit
7f0709888c
@ -25,8 +25,12 @@ func ErrAttr(err any) slog.Attr {
|
||||
return slog.Any(ErrorAttr, err)
|
||||
}
|
||||
|
||||
func HTTPStatus(code int) []any {
|
||||
return []any{slog.Int(HTTPStatusAttr, code), slog.String(HTTPStatusNameAttr, http.StatusText(code))}
|
||||
func HTTPStatusCode(code int) slog.Attr {
|
||||
return slog.Int(HTTPStatusAttr, code)
|
||||
}
|
||||
|
||||
func HTTPStatusName(code int) slog.Attr {
|
||||
return slog.String(HTTPStatusNameAttr, http.StatusText(code))
|
||||
}
|
||||
|
||||
func Body(val any) slog.Attr {
|
||||
|
Loading…
Reference in New Issue
Block a user