Documentation
¶
Index ¶
- func InitHeadersBody(writerExpr string, opts HeaderOptions) []jen.Code
- func InitHeadersSource(writerExpr string, opts HeaderOptions) string
- func WriteAndFlushBody(writeCall jen.Code, writerExpr string) []jen.Code
- func WriteAndFlushSource(writeCall string, writerExpr string) string
- type HeaderOptions
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 ¶
WriteAndFlushBody returns Jennifer statements that write an SSE event using the provided call and then flush the response controller for the writer.
func WriteAndFlushSource ¶
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.
Click to show internal directories.
Click to hide internal directories.