render

package
v0.0.1-alpha.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanToast

func CleanToast(ctx context.Context, w http.ResponseWriter)

func Error500

func Error500(w http.ResponseWriter, r *http.Request)

func Forbidden

func Forbidden(w http.ResponseWriter, r *http.Request)

func HTML

HTML get at templ component and renders to response writer

func HTMLWithBreadCrumb

func HTMLWithBreadCrumb(ctx context.Context, w http.ResponseWriter, c templ.Component)

func HTMLWithToastError

func HTMLWithToastError(ctx context.Context, w http.ResponseWriter, c templ.Component, toastMsg string)

HTMLWithToastError function renders the template component with the error toast

func NotFound

func NotFound(w http.ResponseWriter, r *http.Request)

func Page

func Redirect

func Redirect(w http.ResponseWriter, redirectTo string)

Redirect makes a client side redirection

func RedirectExternal

func RedirectExternal(w http.ResponseWriter, r *http.Request, redirectTo string)

RedirectExternal makes a redirection to an external url

func RedirectWithRefresh

func RedirectWithRefresh(w http.ResponseWriter, redirectTo string)

RedirectWithRefresh redirects the client with a full page refresh, used mostly on error pages

func ResetValidationErrors

func ResetValidationErrors(ctx context.Context, w http.ResponseWriter)

func RootWithNav

func RootWithNav(ctx context.Context, w http.ResponseWriter, c templ.Component, url string)

func RootWithoutNav

func RootWithoutNav(ctx context.Context, w http.ResponseWriter, c templ.Component, url string)

func StreamSSE

func StreamSSE[T *sse.Event | *types.LogLine | *types.ArtifactLogLine](
	ctx context.Context,
	w http.ResponseWriter,
	chStop <-chan struct{},
	chEvents <-chan T,
	chErr <-chan error,
	renderInit func(ctx context.Context, w io.Writer) error,
	renderFunc func(ctx context.Context, w io.Writer, event T) error,
)

func ToastError

func ToastError(ctx context.Context, w http.ResponseWriter, err error)

func ToastErrorMsg

func ToastErrorMsg(ctx context.Context, w http.ResponseWriter, msg string)

func ToastSuccess

func ToastSuccess(ctx context.Context, w http.ResponseWriter, msg string)

func ValidationError

func ValidationError(ctx context.Context, w http.ResponseWriter, key string, msg string)

func ValidationErrors

func ValidationErrors(ctx context.Context, w http.ResponseWriter, errs map[string]string)

func WriteMesageHeader

func WriteMesageHeader(w io.Writer) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL