httpmodel

package
v2.33.17 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	HeaderAuthorization           = "Authorization"
	HeaderContentType             = "Content-Type"
	HeaderClientID                = "X-Client-ID"
	HeaderCacheControl            = "Cache-Control"
	HeaderDataDogTraceID          = trace.DatadogTraceIDHeader
	HeaderDataDogParentID         = trace.DatadogParentIDHeader
	HeaderDataDogSampled          = trace.DatadogSampledHeader
	HeaderDataDogSamplingPriority = trace.DatadogSamplingPriorityHeader
	HeaderDataDogOrigin           = trace.DatadogOriginHeader
	HeaderB3TraceID               = trace.B3TraceIDHeader
	HeaderB3SpanID                = trace.B3SpanIDHeader
	HeaderB3Sampled               = trace.B3SampledHeader

	CacheControlNoCache = "no-cache"
	MimeJSON            = "application/json"
	MimeParameterUTF8   = "charset=utf-8"
)

Variables

View Source
var ErrMessageInternalServerError = "internal server error"
View Source
var ErrMessageNotFound = "not found"
View Source
var ErrMessageUnauthorized = "unauthorized"
View Source
var ErrResponseBadRequest = []byte(`{"error": {"message": "bad request"}}`)
View Source
var ErrResponseInternalServerError = []byte(`{"error": {"message": "internal server error"}}`)
View Source
var ErrResponseMethodNotAllowed = []byte(`{"error": {"message": "method not allowed"}}`)
View Source
var ErrResponseNotFound = []byte(`{"error": {"message": "not found"}}`)
View Source
var ErrResponseTooManyRequests = []byte(`{"error": {"message": "Too many requests"}}`)
View Source
var ErrResponseUnauthorized = []byte(`{"error": {"message": "unauthorized"}}`)
View Source
var ErrResponseUnsupportedMediaType = []byte(`{"error": {"message": "unsupported media type"}}`)

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse struct {
	Error struct {
		Message string `json:"message"`
	} `json:"error"`
}

type HTTPError added in v2.6.0

type HTTPError struct {
	Msg        string
	StatusCode int
}

func (*HTTPError) Error added in v2.6.0

func (e *HTTPError) Error() string

func (*HTTPError) Message added in v2.6.0

func (e *HTTPError) Message() []byte

Jump to

Keyboard shortcuts

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