package turbo

import "github.com/a-h/templ/turbo"

Index

Functions

func Append

func Append(w http.ResponseWriter, target string, template templ.Component) error

Append adds an append action to the output stream.

func AppendWithContext

func AppendWithContext(ctx context.Context, w http.ResponseWriter, target string, template templ.Component) error

AppendWithContext adds an append action to the output stream.

func IsTurboRequest

func IsTurboRequest(r *http.Request) bool

IsTurboRequest returns true if the incoming request is able to receive a Turbo stream. This is determined by checking the request header for "text/vnd.turbo-stream.html"

func Prepend

func Prepend(w http.ResponseWriter, target string, template templ.Component) error

Prepend adds a prepend action to the output stream.

func PrependWithContext

func PrependWithContext(ctx context.Context, w http.ResponseWriter, target string, template templ.Component) error

PrependWithContext adds a prepend action to the output stream.

func Remove

func Remove(w http.ResponseWriter, target string) error

Remove adds a remove action to the output stream.

func RemoveWithContext

func RemoveWithContext(ctx context.Context, w http.ResponseWriter, target string) error

RemoveWithContext adds a remove action to the output stream.

func Replace

func Replace(w http.ResponseWriter, target string, template templ.Component) error

Replace adds a replace action to the output stream.

func ReplaceWithContext

func ReplaceWithContext(ctx context.Context, w http.ResponseWriter, target string, template templ.Component) error

ReplaceWithContext adds a replace action to the output stream.

func Update

func Update(w http.ResponseWriter, target string, template templ.Component) error

Update adds an update action to the output stream.

func UpdateWithContext

func UpdateWithContext(ctx context.Context, w http.ResponseWriter, target string, template templ.Component) error

UpdateWithContext adds an update action to the output stream.

Source Files

stream.go stream_templ.go

Version
v0.3.857 (latest)
Published
Mar 25, 2025
Platform
linux/amd64
Imports
5 packages
Last checked
2 weeks ago

Tools for package owners.