Documentation ¶
Index ¶
- Constants
- func BuildBaseKey(keys ...string) string
- func ConvertFromMap(m map[string]any, target any) error
- func ConvertToMap(target any, m *map[string]any) error
- func DeepCopy(src any, dest any) error
- func MergeMaps(dest map[string]any, src map[string]any)
- func MergeValues(dest any, src any) error
- func RemoveUnusedSettings(src any, baseKey string, usedSettingKeys map[string]any) (map[string]any, error)
- func SendJsonErrResp(lc logger.LoggingClient, writer *echo.Response, request *http.Request, ...) error
- func SendJsonResp(lc logger.LoggingClient, writer *echo.Response, request *http.Request, ...) error
- func StringSliceToMap(src []string) map[string]any
- func WrapHandler(handler func(http.ResponseWriter, *http.Request)) echo.HandlerFunc
Constants ¶
const PathSep = "/"
Variables ¶
This section is empty.
Functions ¶
func BuildBaseKey ¶
func ConvertFromMap ¶
ConvertFromMap uses json to marshal and unmarshal a map into a target type
func ConvertToMap ¶
ConvertToMap uses json to marshal and unmarshal a target type into a map
func DeepCopy ¶
DeepCopy creates a deep copy/clone of a struct by using json to marshal the original struct, and then unmarshal it back into the new copy. Note that this will only copy the exported fields.
func MergeMaps ¶
MergeMaps combines the src map keys and values with the dest map keys and values if the key exists
func MergeValues ¶
MergeValues combines src with the dest.
func RemoveUnusedSettings ¶
func SendJsonErrResp ¶ added in v3.1.0
func SendJsonErrResp( lc logger.LoggingClient, writer *echo.Response, request *http.Request, errKind errors.ErrKind, message string, err error, requestID string) error
SendJsonErrResp puts together the error response packet for the APIs
func SendJsonResp ¶ added in v3.1.0
func SendJsonResp( lc logger.LoggingClient, writer *echo.Response, request *http.Request, response interface{}, statusCode int) error
SendJsonResp puts together the response packet for the APIs
func StringSliceToMap ¶
func WrapHandler ¶ added in v3.1.0
func WrapHandler(handler func(http.ResponseWriter, *http.Request)) echo.HandlerFunc
WrapHandler wraps `handler func(http.ResponseWriter, *http.Request)` into `echo.HandlerFunc`
Types ¶
This section is empty.