Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidContentType = errors.New("invalid content type")
)
Functions ¶
func GetRemoteAddr ¶
GetRemoteAddr returns the remote address of an http request. If an X-Forwarded-For Header is present the headers content is returned. Otherwise the src host of the ip packet is returned.
func Jsonify ¶
func Jsonify(w http.ResponseWriter, v interface{})
Jsonify writes the JSON representation of v to the supplied http.ResposeWriter. If an error occours while marshalling the http response will be an internal server error.
func RandomString ¶
RandomString string returns a random string with the length n. Stolen from https://stackoverflow.com/questions/22892120/how-to-generate-a-random-tring-of-a-fixed-length-in-golang
func WaitSignal ¶
WaitSignal blocks until one of the given OS signals occoures.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.