misc

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// HeaderContentType constant
	HeaderContentType = "Content-Type"
	// HeaderAcceptEncoding constant
	HeaderAcceptEncoding = "Accept-Encoding"
	// HeaderContentEncoding constant
	HeaderContentEncoding = "Content-Encoding"
	// MIMEApplicationJSON constant
	MIMEApplicationJSON = "application/json"
	// MIMEApplicationJSONCharsetUTF8 constant
	MIMEApplicationJSONCharsetUTF8 = MIMEApplicationJSON + "; " + charsetUTF8
	// HeaderXContentTypeOptions constant
	HeaderXContentTypeOptions = "X-Content-Type-Options"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPError

type HTTPError struct {
	Code    int
	Message interface{}
}

HTTPError represents an error that occurred while handling a request.

func NewHTTPError

func NewHTTPError(code int, message ...interface{}) *HTTPError

NewHTTPError creates a new HTTPError instance.

func (*HTTPError) Error

func (he *HTTPError) Error() string

Error makes it compatible with `error` interface.

Jump to

Keyboard shortcuts

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