utils

package
v0.0.0-...-1967991 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUrlPrefix

func GetUrlPrefix(r *http.Request, logger logrus.FieldLogger) string

GetUrlPrefix elaborates the current URL prefix in order to point to this server.

e.g. if the request is received from the server running as http://localhost:12345/ but it detects to be under a reverse proxy, that is adjusted.

func JoinMaps

func JoinMaps[T any](maps ...map[string]T) (map[string]T, error)

func MapGetFirstValue

func MapGetFirstValue[T any](multiValueMap map[string][]T) (map[string]T, error)

func ParamsToMap

func ParamsToMap(params httprouter.Params) (map[string]string, error)

ParamsToMap converts httprouter.Params to a simple map[string]string to have a nice and simple interface, without the implications of a library

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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