problems

package
v0.82.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package problems 提供对 Problem 相关内容的管理

Index

Constants

View Source
const (
	ProblemAboutBlank = "about:blank"

	ProblemBadRequest                    = "400"
	ProblemUnauthorized                  = "401"
	ProblemPaymentRequired               = "402"
	ProblemForbidden                     = "403"
	ProblemNotFound                      = "404"
	ProblemMethodNotAllowed              = "405"
	ProblemNotAcceptable                 = "406"
	ProblemProxyAuthRequired             = "407"
	ProblemRequestTimeout                = "408"
	ProblemConflict                      = "409"
	ProblemGone                          = "410"
	ProblemLengthRequired                = "411"
	ProblemPreconditionFailed            = "412"
	ProblemRequestEntityTooLarge         = "413"
	ProblemRequestURITooLong             = "414"
	ProblemUnsupportedMediaType          = "415"
	ProblemRequestedRangeNotSatisfiable  = "416"
	ProblemExpectationFailed             = "417"
	ProblemTeapot                        = "418"
	ProblemMisdirectedRequest            = "421"
	ProblemUnprocessableEntity           = "422"
	ProblemLocked                        = "423"
	ProblemFailedDependency              = "424"
	ProblemTooEarly                      = "425"
	ProblemUpgradeRequired               = "426"
	ProblemPreconditionRequired          = "428"
	ProblemTooManyRequests               = "429"
	ProblemRequestHeaderFieldsTooLarge   = "431"
	ProblemUnavailableForLegalReasons    = "451"
	ProblemInternalServerError           = "500"
	ProblemNotImplemented                = "501"
	ProblemBadGateway                    = "502"
	ProblemServiceUnavailable            = "503"
	ProblemGatewayTimeout                = "504"
	ProblemHTTPVersionNotSupported       = "505"
	ProblemVariantAlsoNegotiates         = "506"
	ProblemInsufficientStorage           = "507"
	ProblemLoopDetected                  = "508"
	ProblemNotExtended                   = "510"
	ProblemNetworkAuthenticationRequired = "511"
)

Variables

This section is empty.

Functions

func ID added in v0.79.5

func ID(status int) string

func Status

func Status(id string) int

Types

type Problem added in v0.81.0

type Problem struct {
	Type   string // 带 prefix
	Status int
	Title  localeutil.LocaleStringer
	Detail localeutil.LocaleStringer
	// contains filtered or unexported fields
}

type Problems

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

func New

func New(prefix string) *Problems

func (*Problems) Add

func (ps *Problems) Add(id string, status int, title, detail localeutil.LocaleStringer)

func (*Problems) Problem

func (ps *Problems) Problem(id string) *Problem

func (*Problems) Visit added in v0.70.0

func (ps *Problems) Visit(visit func(prefix, id string, status int, title, detail localeutil.LocaleStringer))

Directories

Path Synopsis
Package make 提供一些通用的生成工具
Package make 提供一些通用的生成工具

Jump to

Keyboard shortcuts

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