Documentation ¶
Index ¶
- func BuildAddress(ip, port string) (string, error)
- func CloneRequest(r *http.Request, body []byte) *http.Request
- func DoRequest(method, host, body string, timeout time.Duration) (string, error)
- func ExternalIP() (string, error)
- func GetHostPort(addr string) (host string, port string, err error)
- func Min(a, b int) int
- func NewTemplate(outputTmpl string) *template.Template
- func Now() time.Duration
- func ParseHTTPHeader(in string) ([]string, error)
- func ReadBody(r *http.Request, obj interface{}) (string, error)
- func RespondWithError(w http.ResponseWriter, code int, message string)
- func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
- func RespondWithJSONIndent(w http.ResponseWriter, code int, payload interface{})
- func WaitSignal(stopChan chan struct{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildAddress ¶ added in v0.1.1
func CloneRequest ¶
cloneRequest returns a clone of the provided *http.Request. The clone is a shallow copy of the struct and its Header map.
func ExternalIP ¶
func NewTemplate ¶
func ParseHTTPHeader ¶
func RespondWithError ¶
func RespondWithError(w http.ResponseWriter, code int, message string)
func RespondWithJSON ¶
func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
func RespondWithJSONIndent ¶
func RespondWithJSONIndent(w http.ResponseWriter, code int, payload interface{})
func WaitSignal ¶
func WaitSignal(stopChan chan struct{})
WaitSignal awaits for SIGINT or SIGTERM and closes the channel
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.