Documentation
¶
Index ¶
- func ErrorBadRequest(msg string, errs ...error) core.Error
- func ErrorConflict(msg string, errs ...error) core.Error
- func ErrorForbidden(msg string, errs ...error) core.Error
- func ErrorInternalServerError(msg string, errs ...error) core.Error
- func ErrorN(status int, msg string, errs ...error) core.Error
- func ErrorNotFound(msg string, errs ...error) core.Error
- func ErrorTooManyRequests(msg string, errs ...error) core.Error
- func ErrorUnauthorized(msg string, errs ...error) core.Error
- func ErrorUnprocessableEntity(msg string, errs ...error) core.Error
- func Status304NotModified() core.Error
- type NoopHandler
- func (f *NoopHandler) ErrorContentType(ct string) string
- func (f *NoopHandler) ErrorSchema(_ core.Registry) *core.Schema
- func (f *NoopHandler) NewError(status int, msg string, _ ...error) core.Error
- func (f *NoopHandler) NewErrorWithContext(_ core.Context, status int, msg string, _ ...error) core.Error
- type ProblemDetail
- type RFC9457Handler
- func (f *RFC9457Handler) ErrorContentType(ct string) string
- func (f *RFC9457Handler) ErrorSchema(registry core.Registry) *core.Schema
- func (f *RFC9457Handler) GetTypeBaseURI() string
- func (f *RFC9457Handler) NewError(status int, msg string, errs ...error) core.Error
- func (f *RFC9457Handler) NewErrorWithContext(ctx core.Context, status int, msg string, errs ...error) core.Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Status304NotModified ¶
Types ¶
type NoopHandler ¶
type NoopHandler struct{}
func NewNoopHandler ¶
func NewNoopHandler() *NoopHandler
func (*NoopHandler) ErrorContentType ¶
func (f *NoopHandler) ErrorContentType(ct string) string
func (*NoopHandler) ErrorSchema ¶
func (f *NoopHandler) ErrorSchema(_ core.Registry) *core.Schema
func (*NoopHandler) NewErrorWithContext ¶
type ProblemDetail ¶
type ProblemDetail struct {
Type string `` /* 170-byte string literal not displayed */
Title string `json:"title,omitempty" example:"Bad Request" doc:"A short, human-readable summary of the problem type."`
Status int `json:"status,omitempty" example:"400" doc:"HTTP status code"`
Detail string `` /* 153-byte string literal not displayed */
Instance string `` /* 163-byte string literal not displayed */
Errors []*core.ErrorDetail `json:"errors,omitempty" doc:"Optional list of individual error details"`
}
func (*ProblemDetail) Add ¶
func (e *ProblemDetail) Add(err error)
func (*ProblemDetail) ContentType ¶
func (e *ProblemDetail) ContentType(ct string) string
func (*ProblemDetail) Error ¶
func (e *ProblemDetail) Error() string
func (*ProblemDetail) GetType ¶
func (e *ProblemDetail) GetType() string
func (*ProblemDetail) StatusCode ¶
func (e *ProblemDetail) StatusCode() int
type RFC9457Handler ¶
func NewRFC9457Handler ¶
func NewRFC9457Handler() *RFC9457Handler
func NewRFC9457HandlerWithConfig ¶
func NewRFC9457HandlerWithConfig(typeBaseURI string, instanceFunc func(core.Context) string) *RFC9457Handler
func (*RFC9457Handler) ErrorContentType ¶
func (f *RFC9457Handler) ErrorContentType(ct string) string
func (*RFC9457Handler) ErrorSchema ¶
func (f *RFC9457Handler) ErrorSchema(registry core.Registry) *core.Schema
func (*RFC9457Handler) GetTypeBaseURI ¶
func (f *RFC9457Handler) GetTypeBaseURI() string
func (*RFC9457Handler) NewErrorWithContext ¶
Click to show internal directories.
Click to hide internal directories.