Documentation
¶
Index ¶
- func ReleaseFieldError(fe *FieldError)
- func ReleaseFieldErrors(fe FieldErrors)
- type ErrorObject
- func (e ErrorObject) Error() string
- func (e ErrorObject) GetCode() string
- func (e ErrorObject) GetErrorTemplate() *template.Template
- func (e ErrorObject) MarshalJSON() ([]byte, error)
- func (e ErrorObject) SetErrorTemplate(newTemplate *template.Template) error
- func (e ErrorObject) SetParams(params any) ErrorObject
- type ErrorObjectFactory
- type ErrorSlice
- type Errors
- type Field
- type FieldError
- type FieldErrors
- type NewFieldErrorsOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReleaseFieldError ¶
func ReleaseFieldError(fe *FieldError)
func ReleaseFieldErrors ¶
func ReleaseFieldErrors(fe FieldErrors)
Types ¶
type ErrorObject ¶
type ErrorObject struct {
// contains filtered or unexported fields
}
func NewErrorObject ¶
func NewErrorObject(code string, message string) ErrorObject
NewErrorObject ...
func (ErrorObject) Error ¶
func (e ErrorObject) Error() string
func (ErrorObject) GetCode ¶
func (e ErrorObject) GetCode() string
func (ErrorObject) GetErrorTemplate ¶
func (e ErrorObject) GetErrorTemplate() *template.Template
func (ErrorObject) MarshalJSON ¶
func (e ErrorObject) MarshalJSON() ([]byte, error)
func (ErrorObject) SetErrorTemplate ¶
func (e ErrorObject) SetErrorTemplate(newTemplate *template.Template) error
func (ErrorObject) SetParams ¶
func (e ErrorObject) SetParams(params any) ErrorObject
type ErrorObjectFactory ¶
type ErrorObjectFactory interface {
NewErrorObject(code string) ErrorObject
}
func DefaultErrorObjectFactory ¶
func DefaultErrorObjectFactory() ErrorObjectFactory
DefaultErrorObjectFactory ...
func NewErrorObjectFactory ¶
func NewErrorObjectFactory(registry translationRegistry) ErrorObjectFactory
type ErrorSlice ¶
type ErrorSlice []error
func (ErrorSlice) AppendError ¶
func (es ErrorSlice) AppendError(err error) ErrorSlice
func (ErrorSlice) Error ¶
func (es ErrorSlice) Error() string
func (ErrorSlice) MarshalJSON ¶
func (es ErrorSlice) MarshalJSON() ([]byte, error)
type Errors ¶
func FieldErrorToErrors ¶
func FieldErrorToErrors(fs FieldErrors) Errors
func (Errors) MarshalJSON ¶
MarshalJSON converts the Errors into a valid JSON.
type Field ¶
func NewStringField ¶
type FieldError ¶
type FieldError struct {
Field string
// contains filtered or unexported fields
}
func NewFieldError ¶
func NewFieldError(fieldName string, err error) *FieldError
func (*FieldError) Error ¶
func (f *FieldError) Error() string
type FieldErrors ¶
type FieldErrors []*FieldError
func NewFieldErrors ¶
func NewFieldErrors(opts ...NewFieldErrorsOpt) FieldErrors
func (FieldErrors) Error ¶
func (fes FieldErrors) Error() string
type NewFieldErrorsOpt ¶
type NewFieldErrorsOpt func(opt *newFieldErrorsOpt)
func WithStartCap ¶
func WithStartCap(startCap int) NewFieldErrorsOpt
Source Files
¶
Click to show internal directories.
Click to hide internal directories.