package
1.1.1
Repository: https://github.com/subtlepseudonym/go-utils.git
Documentation: pkg.go.dev

# Functions

GetPublicIP retrieves the public IP address of the computer where this function is run This function will return an error if there is no internet connection and, as of v2.0.0, depends upon ipify.org.
LogPublicIpAddress is a convenience function for getting your public IP and passing it directly to a logger with predefined formatting.
SimpleHttpResponse writes the provided HTTP status code back to the client, formats the message into a simple JSON object, and writes that back to the client Deprecated: Use SimpleJSONResponse instead.
SimpleJSONResponse writes the provided HTTP status code back to the client, formats the message into a simple JSON object, and writes that back to the client func HealthHandler(w http.ResponseWriter, r *http.Request) { _, err := SimpleJSONResponse(w, http.StatusOK, "Still alive") if err != nil { log.Printf("ERR: write response to client failed: %s", err) } }.