http

package
v0.7.8 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Location                 string = "Location"
	ContentType              string = "Content-Type"
	ContentEncoding          string = "Content-Encoding"
	CacheControl             string = "Cache-Control"
	ETag                     string = "ETag"
	Authorization            string = "Authorization"
	AccessControlAllowOrigin string = "Access-Control-Allow-Origin"
	AcceptEncoding           string = "Accept-Encoding"
	XForwardProtocol         string = "X-Forwarded-Proto"
	XForwardHost             string = "X-Forwarded-Host"
	XForwardUri              string = "X-Forwarded-Uri"
)
View Source
const (
	AuthBasic  string = "Basic"
	AuthBearer string = "Bearer"
)
View Source
const (
	ContentTypeJSON string = "application/json"
)

Variables

This section is empty.

Functions

func SendJson

func SendJson(value any, w http.ResponseWriter, r *http.Request) error

func SendJsonWithStatus

func SendJsonWithStatus(value any, statusCode int, w http.ResponseWriter, r *http.Request) error

Types

type CompressionMethod added in v0.7.8

type CompressionMethod string
const (
	CompressionMethodGZip CompressionMethod = "gzip"
)

type RequestData added in v0.7.6

type RequestData struct {
	// contains filtered or unexported fields
}

func NewRequestData added in v0.7.6

func NewRequestData(r *http.Request) *RequestData

func (*RequestData) AcceptCompressed added in v0.7.8

func (r *RequestData) AcceptCompressed() (*CompressionMethod, bool)

func (*RequestData) IssuerString added in v0.7.6

func (r *RequestData) IssuerString() string

func (*RequestData) URL added in v0.7.6

func (r *RequestData) URL() (*url.URL, error)

func (*RequestData) Valid added in v0.7.8

func (r *RequestData) Valid() bool

type ResponseWriter added in v0.7.8

type ResponseWriter struct {
	// contains filtered or unexported fields
}

func NewResponseWriter added in v0.7.8

func NewResponseWriter(w http.ResponseWriter, requestData *RequestData) *ResponseWriter

func (*ResponseWriter) SetEncodingHeader added in v0.7.8

func (rw *ResponseWriter) SetEncodingHeader()

func (*ResponseWriter) Write added in v0.7.8

func (rw *ResponseWriter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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