Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTokenFromBearerString ¶
GetTokenFromBearerString take a 'Bearer ...' string from a http.request header and returns the token without the Bearer prefix.
Returns error if auth string is empty
func HealthcheckHandler ¶
func HealthcheckHandler(w http.ResponseWriter, r *http.Request)
HealthcheckHandler is a quick mux route useful only for responding to checks of the server being alive
func New ¶
New returns a standard server with a single mux route of "/_healthcheck" which responds '200 OK'.
If a mux is passed the above route is merged in and panics if already exists
func ValueFromReqQueryOrHeader ¶
ValueFromReqQueryOrHeader finds a value from either the URL query string or the header using the given key.
Useful when giving the client multiple methods to submit a value depending on their use case
Checks URL query strings first and will return that value even if both are present.
Both header and query string are checked as case insensitive.
The first value found is returned.
Types ¶
This section is empty.