Documentation ¶
Index ¶
- Constants
- func GetRelativePath(pathBase string, path string) string
- func LowercaseURLPath(next http.Handler) http.Handler
- func NormalizePath(next http.Handler) http.Handler
- func Recoverer(h http.Handler) http.Handler
- func RemoveRemoteAddr(next http.Handler) http.Handler
- func WithLogger(h http.Handler) http.Handler
Constants ¶
const ( PlanesSegment = "/planes" ResourceGroupsSegment = "/resourcegroups" )
Variables ¶
This section is empty.
Functions ¶
func GetRelativePath ¶
GetRelativePath returns the relative path of the given path with respect to the pathBase.
func LowercaseURLPath ¶
LowercaseURLPath sets the Referer header to the original URL if it is not already set, and then lowercases the URL path before passing it to the next handler.
func NormalizePath ¶
NormalizePath replaces any occurrences of "planes" and "resourcegroups" in the URL path with the correct case and preserves the case for the rest of the URL. For example, the user could specify the url as /Planes/radius/local/resourceGroups/abc and this will translate it to: /planes/radius/local/resourcegroups/abc
func Recoverer ¶
Recoverer handles panics and logs the error, returning an Internal Server Error response.
func RemoveRemoteAddr ¶
RemoveRemoteAddr is the middleware to remove remoteaddr to avoid high cardinality in metrics. This is a temporary workaround until opentelemetry-go fixes the issue - https://github.com/open-telemetry/opentelemetry-go-contrib/issues/3765
Types ¶
This section is empty.