response

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON(w http.ResponseWriter, status int, data any) error

func JSONWithHeaders

func JSONWithHeaders(w http.ResponseWriter, status int, data any, headers http.Header) error

func NamedTemplate

func NamedTemplate(w http.ResponseWriter, status int, data any, templateName string, patterns ...string) error

func NamedTemplateWithHeaders

func NamedTemplateWithHeaders(w http.ResponseWriter, status int, data any, headers http.Header, templateName string, patterns ...string) error

func Page

func Page(w http.ResponseWriter, status int, data any, pagePath string) error

func PageWithHeaders

func PageWithHeaders(w http.ResponseWriter, status int, data any, headers http.Header, pagePath string) error

Types

type MetricsResponseWriter

type MetricsResponseWriter struct {
	StatusCode int
	BytesCount int
	// contains filtered or unexported fields
}

func NewMetricsResponseWriter

func NewMetricsResponseWriter(w http.ResponseWriter) *MetricsResponseWriter

func (*MetricsResponseWriter) Flush

func (mw *MetricsResponseWriter) Flush()

func (*MetricsResponseWriter) Header

func (mw *MetricsResponseWriter) Header() http.Header

func (*MetricsResponseWriter) Unwrap

func (*MetricsResponseWriter) Write

func (mw *MetricsResponseWriter) Write(b []byte) (int, error)

func (*MetricsResponseWriter) WriteHeader

func (mw *MetricsResponseWriter) WriteHeader(statusCode int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳