utils

package
v1.12.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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."

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 FilterList(list []string, valuesToFilter []string) []string

func HasApplicationJSONContentType added in v1.6.3

func HasApplicationJSONContentType(headers http.Header) bool

func ReadFile added in v1.6.3

func ReadFile(path string) ([]byte, error)

func SanitizeString added in v1.3.0

func SanitizeString(input string) string

func UnmarshalHeader added in v1.6.3

func UnmarshalHeader(headers http.Header, headerKey string, v interface{}) (bool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL