(Feat): Initial Commit
Some checks failed
Build & Test / build-test (push) Has been cancelled
Build & Test / swagger-codegen-cli (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled

This commit is contained in:
2026-07-03 19:41:31 +05:30
commit 7e940c83a7
461 changed files with 45002 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package router
import (
"fmt"
"html/template"
"io"
"allaboutapps.dev/aw/go-starter/internal/api/router/templates"
"github.com/labstack/echo/v4"
)
type echoRenderer struct {
templates map[templates.ViewTemplate]*template.Template
}
func (t *echoRenderer) Render(writer io.Writer, name string, data interface{}, _ echo.Context) error {
tmplHTML, ok := t.templates[templates.ViewTemplate(name)]
if !ok {
return fmt.Errorf("template not found: %s", name)
}
if err := tmplHTML.Execute(writer, data); err != nil {
return fmt.Errorf("failed to execute template: %w", err)
}
return nil
}