problems

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotFound

func IsNotFound(err error) bool

func IsValidationError

func IsValidationError(err error) bool

Types

type Field

type Field struct {
	Field  string `json:"field"`
	Detail string `json:"detail"`
}

type Problem

type Problem interface {
	error
	Code() int
}

func BadRequest

func BadRequest(detail string) Problem

func Conflict

func Conflict(detail string) Problem

func Forbidden

func Forbidden(title, detail string) Problem

func InternalServerError

func InternalServerError(title, detail string) Problem

func MethodNotAllowed

func MethodNotAllowed(method string) Problem

func NewProblemOfError

func NewProblemOfError(err error) Problem

func NotFound

func NotFound(ref ...string) Problem

func Unauthorized

func Unauthorized(title, detail string) Problem

func ValidationError

func ValidationError(field, detail string) Problem

func ValidationErrors

func ValidationErrors(fieldsMap map[string]string, detail ...string) Problem

type ProblemBuilder

type ProblemBuilder interface {
	Build() Problem
	Type(string) ProblemBuilder
	Status(int) ProblemBuilder
	Title(string) ProblemBuilder
	Detail(string) ProblemBuilder
	Instance(string) ProblemBuilder
	Fields(...Field) ProblemBuilder
}

func Builder

func Builder() ProblemBuilder

Jump to

Keyboard shortcuts

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