mirror of
https://github.com/cubixle/tuu.git
synced 2026-04-30 17:48:44 +01:00
SAVEPOINT
This commit is contained in:
+6
-6
@@ -1,7 +1,9 @@
|
|||||||
package tuu
|
package tuu
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
@@ -68,9 +70,7 @@ func (d *DefaultContext) Value(key interface{}) interface{} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *DefaultContext) Render(status int, rr render.Renderer) error {
|
func (d *DefaultContext) Render(status int, rr render.Renderer) error {
|
||||||
//p := plush.NewContext()
|
if rr != nil {
|
||||||
|
|
||||||
/*if rr != nil {
|
|
||||||
data := d.data
|
data := d.data
|
||||||
pp := map[string]string{}
|
pp := map[string]string{}
|
||||||
for k, v := range d.params {
|
for k, v := range d.params {
|
||||||
@@ -83,19 +83,19 @@ func (d *DefaultContext) Render(status int, rr render.Renderer) error {
|
|||||||
|
|
||||||
err := rr.Render(bb, data)
|
err := rr.Render(bb, data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return HTTPError{Status: 500, Cause: errors.WithStack(err)}
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
d.Response().Header().Set("Content-Type", rr.ContentType())
|
d.Response().Header().Set("Content-Type", rr.ContentType())
|
||||||
d.Response().WriteHeader(status)
|
d.Response().WriteHeader(status)
|
||||||
_, err = io.Copy(d.Response(), bb)
|
_, err = io.Copy(d.Response(), bb)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return HTTPError{Status: 500, Cause: errors.WithStack(err)}
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
d.Response().WriteHeader(status)
|
d.Response().WriteHeader(status)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/lukerodham/tuu"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"gitlab.com/lrodham/tuu"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_Route_Creation(t *testing.T) {
|
func Test_Route_Creation(t *testing.T) {
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ package examples
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
"gitlab.com/lrodham/tuu"
|
|
||||||
|
"github.com/gin-gonic/gin/render"
|
||||||
|
"github.com/lukerodham/tuu"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
Reference in New Issue
Block a user