Documentation ¶
Index ¶
- Constants
- Variables
- func FailResponse(w http.ResponseWriter, technicalError, businessError string)
- func FailResponseWithCode(w http.ResponseWriter, statusCode int, technicalError, businessError string)
- func FilterList(list []string, valuesToFilter []string) []string
- func HasApplicationJSONContentType(headers http.Header) bool
- func ReadFile(path string) ([]byte, error)
- func SanitizeString(input string) string
- func ToMap(tagTitle string, val interface{}) map[string]any
- func UnmarshalHeader(headers http.Header, headerKey string, v interface{}) (bool, error)
Constants ¶
View Source
const ContentTypeHeaderKey = "content-type"
View Source
const GENERIC_BUSINESS_ERROR_MESSAGE = "Internal server error, please try again later"
View Source
const JSONContentTypeHeader = "application/json"
View Source
const NO_PERMISSIONS_ERROR_MESSAGE = "You do not have permissions to access this feature, contact the administrator for more information."
View Source
const OmitEmptyTagOption = "omitempty"
Variables ¶
View Source
var Contains = lo.Contains[string]
View Source
var ErrFileLoadFailed = errors.New("file loading failed")
View Source
var Union = lo.Union[string]
Functions ¶
func FailResponse ¶ added in v1.6.3
func FailResponse(w http.ResponseWriter, technicalError, businessError string)
func FailResponseWithCode ¶ added in v1.6.3
func FailResponseWithCode(w http.ResponseWriter, statusCode int, technicalError, businessError string)
func FilterList ¶
func HasApplicationJSONContentType ¶ added in v1.6.3
func SanitizeString ¶ added in v1.3.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.