getting the flow control more like I envisioned it

This commit is contained in:
2025-09-13 17:21:12 -06:00
parent e2580402b8
commit 8de70e5d07
4 changed files with 48 additions and 8 deletions
+12 -3
View File
@@ -9,24 +9,33 @@
package ui
import (
"net/http"
"github.com/labstack/echo/v4"
)
type AmContext interface {
Render(int, string, interface{}) error
Render(string) error
SetRC(int)
}
type amContext struct {
echoContext echo.Context
httprc int
}
func (c *amContext) Render(code int, name string, data interface{}) error {
return c.echoContext.Render(code, name, data)
func (c *amContext) Render(name string) error {
return c.echoContext.Render(c.httprc, name, c)
}
func (c *amContext) SetRC(rc int) {
c.httprc = rc
}
func NewAmContext(ctxt echo.Context) AmContext {
rc := amContext{
echoContext: ctxt,
httprc: http.StatusOK,
}
return &rc
}