Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorCustomizer ¶
type ErrorCustomizer interface {
InvalidRequestParameterError(error) interface{}
UserAuthenticationError(error) interface{}
ServerError(error) interface{}
NoDataError(error) interface{}
}
ErrorCustomizer used to transform low-level errors before render them to http response. It could be used to provide app-specific error code or i18n. Values returned by interface methods are marshalled into response. Note, that with current implementation, JSON marshaller used to marshall errors. Errors may be any structures, not necessary implement error interface. ErrorCustomizer implementation should hide low-level details (stack trace, technical error details) from the end user.
func NewErrorCustomizer ¶
func NewErrorCustomizer() ErrorCustomizer
Click to show internal directories.
Click to hide internal directories.