Finish first API version

This commit is contained in:
Daniel 2018-09-27 15:58:31 +02:00
parent d7e0602548
commit 31c09512a0
6 changed files with 175 additions and 22 deletions

22
api/enriched-response.go Normal file
View file

@ -0,0 +1,22 @@
package api
import (
"net/http"
)
type EnrichedResponseWriter struct {
http.ResponseWriter
Status int
}
func NewEnrichedResponseWriter(w http.ResponseWriter) *EnrichedResponseWriter {
return &EnrichedResponseWriter{
w,
0,
}
}
func (ew *EnrichedResponseWriter) WriteHeader(code int) {
ew.Status = code
ew.ResponseWriter.WriteHeader(code)
}