hotwired

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	StreamContentType = "text/vnd.turbo-stream.html"

	ActionNameAppend  = "append"
	ActionNamePrepend = "prepend"
)

Variables

This section is empty.

Functions

func IsTurbo added in v0.2.2

func IsTurbo(r *http.Request) bool

func TurboFrameName added in v0.2.2

func TurboFrameName(r *http.Request) string

Types

type Stream

type Stream struct {
	Buffer bytes.Buffer
}

func (*Stream) Append

func (stream *Stream) Append(target string, safeContent string)

func (*Stream) Build added in v0.2.2

func (stream *Stream) Build() StreamData

func (*Stream) Custom added in v0.2.2

func (stream *Stream) Custom(action string, attrs map[string]any)

func (*Stream) CustomContent added in v0.2.2

func (stream *Stream) CustomContent(action string, attrs map[string]any, safeContent string)

func (*Stream) Prepend

func (stream *Stream) Prepend(target string, safeContent string)

func (*Stream) Replace

func (stream *Stream) Replace(target string, safeContent string)

type StreamData added in v0.2.2

type StreamData []byte

Jump to

Keyboard shortcuts

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