package
1.0.7
Repository: https://github.com/atselvan/go-utils.git
Documentation: pkg.go.dev

# Functions

BasicAuth is a gin middleware for validation if basic authentication is provided in the request and the auth user and password matches with the stored user accounts.
BasicAuthError writes an errors to the gin context if basic authentication is not provided.
BasicAuthFailed writes a errors to the gin context if basic authentication fails.
BasicAuthRequired is a gin middleware for checking if basic authentication is provided in the request The method writes the basic auth to the gin context The method returns an errors if basic authentication is not set.
No description provided by the author
GetBasicAuthFromHeader gets basics authentication from the Authorization header.
GetServerURL formats and returns the server url.
Health controller handles requests on the /health endpoint.
MethodNotAllowed method not allowed controller handles request on known endpoints but on methods that are not configured.
NewRouter returns a new gin router which is configured with some settings for logging, auto recovery in case of panics and default handlers for NoRoute and MethodNotAllowed.
NewStringToJsonResponder is a custom httpmock.Responder that takes the status code and a json string body and creates a responder for a http mock.
NoRoute no route controller handles request on endpoints that are not configured.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

RestErr represents an error returned by a REST API.
RestMsg represents a message returned by a REST API.