response

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WritingStatusLine int = iota
	WritingHeaders
	WritingBody
	WritingTrailers
	Done
)

Variables

This section is empty.

Functions

func GetDefaultHeaders

func GetDefaultHeaders(contentLen int) headers.Headers

Types

type StatusCode

type StatusCode int
const (
	OK                    StatusCode = 200
	BAD_REQUEST           StatusCode = 400
	INTERNAL_SERVER_ERROR StatusCode = 500
)

type Writer

type Writer struct {
	Buffer io.Writer
	// contains filtered or unexported fields
}

func (*Writer) Write

func (w *Writer) Write(p []byte) (n int, err error)

func (*Writer) WriteBody

func (w *Writer) WriteBody(p []byte) (int, error)

func (*Writer) WriteChunkedBody

func (w *Writer) WriteChunkedBody(p []byte) (int, error)

func (*Writer) WriteChunkedBodyDone

func (w *Writer) WriteChunkedBodyDone() (int, error)

func (*Writer) WriteHeaders

func (w *Writer) WriteHeaders(headers headers.Headers) error

func (*Writer) WriteStatusLine

func (w *Writer) WriteStatusLine(statusCode StatusCode) error

func (*Writer) WriteTrailers

func (w *Writer) WriteTrailers(trailers headers.Headers) error

Jump to

Keyboard shortcuts

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