Documentation ¶
Overview ¶
Package helper provides common helper functions for handling HTTP requests and errors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientError ¶
func ClientError(w http.ResponseWriter, status int)
ClientError logs a client error and responds with the specified HTTP status code.
func CorrectPunctuationsSpaces ¶
CorrectPunctuationsSpaces takes an input string and adds spaces around punctuation marks based on the specified rules duscribed by inner function applyPunctuationRules. Punctuation marks are placed close to the previous word and separated by a space from the following content. Exceptions include groups of punctuation like '...' or '!?'.
func ServerError ¶
func ServerError(w http.ResponseWriter, err error)
ServerError logs a server error, including the error message and stack trace, and responds with a 500 Internal Server Error status code
Types ¶
This section is empty.