Documentation ¶
Index ¶
- func Map[T error](funcProblem func() ProblemDetailErr)
- func MapStatus(statusCode int, funcProblem func() ProblemDetailErr)
- type ProblemDetail
- func (p *ProblemDetail) GetDetails() string
- func (p *ProblemDetail) GetInstance() string
- func (p *ProblemDetail) GetStackTrace() string
- func (p *ProblemDetail) GetStatus() int
- func (p *ProblemDetail) GetTitle() string
- func (p *ProblemDetail) GetType() string
- func (p *ProblemDetail) SetDetail(detail string) ProblemDetailErr
- func (p *ProblemDetail) SetInstance(instance string) ProblemDetailErr
- func (p *ProblemDetail) SetStackTrace(stackTrace string) ProblemDetailErr
- func (p *ProblemDetail) SetStatus(status int) ProblemDetailErr
- func (p *ProblemDetail) SetTitle(title string) ProblemDetailErr
- func (p *ProblemDetail) SetType(typ string) ProblemDetailErr
- type ProblemDetailErr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Map ¶
func Map[T error](funcProblem func() ProblemDetailErr)
Map map custom type error to problem details error
func MapStatus ¶
func MapStatus(statusCode int, funcProblem func() ProblemDetailErr)
MapStatus map status code to problem details error
Types ¶
type ProblemDetail ¶
type ProblemDetail struct { Status int `json:"status,omitempty"` Title string `json:"title,omitempty"` Detail string `json:"detail,omitempty"` Type string `json:"type,omitempty"` Instance string `json:"instance,omitempty"` StackTrace string `json:"stackTrace,omitempty"` }
func (*ProblemDetail) GetDetails ¶
func (p *ProblemDetail) GetDetails() string
func (*ProblemDetail) GetInstance ¶
func (p *ProblemDetail) GetInstance() string
func (*ProblemDetail) GetStackTrace ¶
func (p *ProblemDetail) GetStackTrace() string
func (*ProblemDetail) GetStatus ¶
func (p *ProblemDetail) GetStatus() int
func (*ProblemDetail) GetTitle ¶
func (p *ProblemDetail) GetTitle() string
func (*ProblemDetail) GetType ¶
func (p *ProblemDetail) GetType() string
func (*ProblemDetail) SetDetail ¶
func (p *ProblemDetail) SetDetail(detail string) ProblemDetailErr
func (*ProblemDetail) SetInstance ¶
func (p *ProblemDetail) SetInstance(instance string) ProblemDetailErr
func (*ProblemDetail) SetStackTrace ¶
func (p *ProblemDetail) SetStackTrace(stackTrace string) ProblemDetailErr
func (*ProblemDetail) SetStatus ¶
func (p *ProblemDetail) SetStatus(status int) ProblemDetailErr
func (*ProblemDetail) SetTitle ¶
func (p *ProblemDetail) SetTitle(title string) ProblemDetailErr
func (*ProblemDetail) SetType ¶
func (p *ProblemDetail) SetType(typ string) ProblemDetailErr
type ProblemDetailErr ¶
type ProblemDetailErr interface { SetStatus(status int) ProblemDetailErr GetStatus() int SetTitle(title string) ProblemDetailErr GetTitle() string SetDetail(detail string) ProblemDetailErr GetDetails() string SetType(typ string) ProblemDetailErr GetType() string SetInstance(instance string) ProblemDetailErr GetInstance() string SetStackTrace(stackTrace string) ProblemDetailErr GetStackTrace() string }
ProblemDetailErr ProblemDetail error interface
func ResolveProblemDetails ¶
func ResolveProblemDetails(w http.ResponseWriter, r *http.Request, err error) (ProblemDetailErr, error)
ResolveProblemDetails retrieve and resolve error with format problem details error
Click to show internal directories.
Click to hide internal directories.