1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2024-10-30 15:50:04 -04:00
moneygo/internal/handlers/util.go

24 lines
361 B
Go
Raw Normal View History

package handlers
2015-06-25 22:36:58 -04:00
import (
"fmt"
"net/http"
)
type ResponseWrapper struct {
Code int
Writer ResponseWriterWriter
}
func (r ResponseWrapper) Write(w http.ResponseWriter) error {
w.WriteHeader(r.Code)
return r.Writer.Write(w)
}
type SuccessWriter struct{}
func (s SuccessWriter) Write(w http.ResponseWriter) error {
fmt.Fprint(w, "{}")
return nil
}