Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateFeedbackMessage ¶
func Unmarshal ¶
func Unmarshal(body io.ReadCloser, v interface{}) error
unmarshal is an aux function to read the provided ReadCloser and unmarshal it to the provided model struct
Types ¶
type API ¶
type API struct { Cfg *config.Config Router chi.Router EmailSender EmailSender }
API provides a struct to wrap the api around
func (*API) PostFeedback ¶
func (api *API) PostFeedback(w http.ResponseWriter, r *http.Request)
PostFeedback is the handler for POST /feedback It unmarshals and validates the feedback data before sending to configured email account
Click to show internal directories.
Click to hide internal directories.