ssecodegen

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitHeadersBody

func InitHeadersBody(writerExpr string, opts HeaderOptions) []jen.Code

InitHeadersBody returns Jennifer statements that initialize SSE response headers for the given writer expression.

func InitHeadersSource

func InitHeadersSource(writerExpr string, opts HeaderOptions) string

InitHeadersSource renders source code that initializes SSE response headers for the given writer expression.

func WriteAndFlushBody

func WriteAndFlushBody(writeCall jen.Code, writerExpr string) []jen.Code

WriteAndFlushBody returns Jennifer statements that write an SSE event using the provided call and then flush the response controller for the writer.

func WriteAndFlushSource

func WriteAndFlushSource(writeCall string, writerExpr string) string

WriteAndFlushSource renders source that writes an SSE event with the given call expression and flushes the response controller.

Types

type HeaderOptions

type HeaderOptions struct {
	// PreserveExisting keeps caller-supplied header values when they are set.
	PreserveExisting bool
	// IncludeAccelBuffering emits X-Accel-Buffering: no for proxy buffering control.
	IncludeAccelBuffering bool
}

HeaderOptions controls how generated SSE header initialization behaves.

Jump to

Keyboard shortcuts

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