Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = &ErrResponse{ HTTPStatusCode: http.StatusNotFound, StatusText: "Resource not found", } ErrInternalServerError = &ErrResponse{ HTTPStatusCode: http.StatusInternalServerError, StatusText: "Internal server error", } ErrBadRequest = &ErrResponse{ HTTPStatusCode: http.StatusBadRequest, StatusText: "Bad request", } )
Functions ¶
Types ¶
type CreatePeopleRequest ¶
type ErrResponse ¶
type ErrResponse struct { Err error `json:"-"` HTTPStatusCode int `json:"-"` StatusText string `json:"status"` AppCode int64 `json:"code,omitempty"` ErrorText string `json:"error,omitempty"` }
func ErrUnprocessableEntity ¶
func ErrUnprocessableEntity(err error) *ErrResponse
func (*ErrResponse) Render ¶
func (e *ErrResponse) Render(w http.ResponseWriter, r *http.Request) error
type FilterRequest ¶
type PeopleResponse ¶
type PeopleResponse struct { ID uuid.UUID `json:"id" db:"id"` FirstName string `json:"first_name" db:"first_name"` LastName string `json:"last_name" db:"last_name"` Patronymic string `json:"patronymic" db:"patronymic"` Age int `json:"age" db:"age"` Sex string `json:"sex" db:"sex"` Nation string `json:"nation" db:"nation"` Deleted bool `json:"deleted" db:"deleted"` }
func NewPeopleResponse ¶
func NewPeopleResponse(people dto.People) *PeopleResponse
func (*PeopleResponse) Render ¶
func (*PeopleResponse) Render(w http.ResponseWriter, req *http.Request) error
Click to show internal directories.
Click to hide internal directories.