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:
@ -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, "{}")
|
||||
}
|
||||
|
Reference in New Issue
Block a user