httputil

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package httputil a package for handling http data tasks

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SupportsProcessing

func SupportsProcessing(request *http.Request) bool

SupportsProcessing determine if http.Request is supported by this plugin.

Types

type ResponseWrapper

type ResponseWrapper struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

ResponseWrapper a wrapper used to simplify ResponseWriter data access and manipulation.

func (*ResponseWrapper) GetBuffer

func (wrapper *ResponseWrapper) GetBuffer() *bytes.Buffer

GetBuffer get a pointer to the ResponseWriter buffer.

func (*ResponseWrapper) GetContent

func (wrapper *ResponseWrapper) GetContent() ([]byte, error)

GetContent load the content currently in the internal buffer accounting for possible encoding.

func (*ResponseWrapper) GetContentEncoding

func (wrapper *ResponseWrapper) GetContentEncoding() string

GetContentEncoding get the Content-Encoding header value.

func (*ResponseWrapper) GetContentType

func (wrapper *ResponseWrapper) GetContentType() string

GetContentType get the Content-Encoding header value.

func (*ResponseWrapper) SetContent

func (wrapper *ResponseWrapper) SetContent(data []byte)

SetContent write data to the internal ResponseWriter buffer and match initial encoding.

func (*ResponseWrapper) SetLastModified

func (wrapper *ResponseWrapper) SetLastModified(value bool)

SetLastModified update the local lastModified variable from non-package-based users.

func (*ResponseWrapper) SupportsProcessing

func (wrapper *ResponseWrapper) SupportsProcessing() bool

SupportsProcessing determine if HttpWrapper is supported by this plugin based on encoding.

func (*ResponseWrapper) Write

func (wrapper *ResponseWrapper) Write(data []byte) (int, error)

Write data to internal buffer and mark the status code as http.StatusOK.

func (*ResponseWrapper) WriteHeader

func (wrapper *ResponseWrapper) WriteHeader(statusCode int)

WriteHeader into wrapped ResponseWriter.

Jump to

Keyboard shortcuts

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