errors

package
v0.0.0-...-a5469ec Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2015 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Overview

Utility functions for producing errorneous http responses

Index

Constants

View Source
const (
	StatusTooManyRequests = 429
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Formatter

type Formatter interface {
	Format(ProxyError) (statusCode int, body []byte, contentType string)
}

type HttpError

type HttpError struct {
	StatusCode int
	Body       string
}

func FromStatus

func FromStatus(statusCode int) *HttpError

func (*HttpError) Error

func (r *HttpError) Error() string

func (*HttpError) GetStatusCode

func (r *HttpError) GetStatusCode() int

type JsonFormatter

type JsonFormatter struct {
}

func (*JsonFormatter) Format

func (f *JsonFormatter) Format(err ProxyError) (int, []byte, string)

type ProxyError

type ProxyError interface {
	GetStatusCode() int
	Error() string
}

Jump to

Keyboard shortcuts

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