1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-03 12:48:38 -04:00

Use SQL transactions for the entirety of every request

This commit is contained in:
2017-10-14 14:20:50 -04:00
parent 6726d9cb2f
commit 4e53a5e59c
14 changed files with 496 additions and 989 deletions

View File

@ -18,6 +18,23 @@ func GetURLPieces(url string, format string, a ...interface{}) (int, error) {
return fmt.Sscanf(url, format, a...)
}
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
}
func WriteSuccess(w http.ResponseWriter) {
fmt.Fprint(w, "{}")
}