Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultBufferSize = 4 * 1024 // 4KB
DefaultBufferSize is the default size of buffers. It is set to 4KB by default, which is the same as the default buffer size of bufio.Writer.
Functions ¶
func GeneratedTemplate ¶
func GeneratedTemplate(f func(GeneratedComponentInput) error) templ.Component
GeneratedTemplate is used to avoid generated code needing to import the `context` and `io` packages.
func ReleaseBuffer ¶
ReleaseBuffer flushes the buffer and returns it to the pool.
Types ¶
type Buffer ¶
Buffer is a wrapper around bufio.Writer that enables flushing and closing of the underlying writer.
func GetBuffer ¶
GetBuffer creates and returns a new buffer if the writer is not already a buffer, or returns the existing buffer if it is.
func (*Buffer) Close ¶
Close closes the buffer and the underlying io.Writer if it implements io.Closer.
func (*Buffer) Flush ¶
Flush writes any buffered data to the underlying io.Writer and calls the Flush method of the underlying http.Flusher if it implements it.