Documentation
¶
Index ¶
- type DefaultRecorder
- func (recorder *DefaultRecorder) AppendEndArray(indent string, jsonPath string) Recorder
- func (recorder *DefaultRecorder) AppendEndObject(indent string, jsonPath string) Recorder
- func (recorder *DefaultRecorder) AppendFieldName(indent string, fieldName string) Recorder
- func (recorder *DefaultRecorder) AppendIgnoreField(indent string, jsonPath string) Recorder
- func (recorder *DefaultRecorder) AppendMissingFieldErrorSignal(indent string, path string) Recorder
- func (recorder *DefaultRecorder) AppendNewLine() Recorder
- func (recorder *DefaultRecorder) AppendStartArray(indent string, jsonPath string) Recorder
- func (recorder *DefaultRecorder) AppendStartObject(indent string, jsonPath string) Recorder
- func (recorder *DefaultRecorder) AppendValidationErrorSignal(message string) Recorder
- func (recorder *DefaultRecorder) AppendValue(indent string, jsonPath string, value any, kind reflect.Kind) Recorder
- func (recorder *DefaultRecorder) GetLog() string
- type Recorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultRecorder ¶
type DefaultRecorder struct {
// contains filtered or unexported fields
}
DefaultRecorder used in clarum validations. As this implementation uses the strings.Builder, it is not goroutine safe!
func (*DefaultRecorder) AppendEndArray ¶
func (recorder *DefaultRecorder) AppendEndArray(indent string, jsonPath string) Recorder
func (*DefaultRecorder) AppendEndObject ¶
func (recorder *DefaultRecorder) AppendEndObject(indent string, jsonPath string) Recorder
func (*DefaultRecorder) AppendFieldName ¶
func (recorder *DefaultRecorder) AppendFieldName(indent string, fieldName string) Recorder
func (*DefaultRecorder) AppendIgnoreField ¶
func (recorder *DefaultRecorder) AppendIgnoreField(indent string, jsonPath string) Recorder
func (*DefaultRecorder) AppendMissingFieldErrorSignal ¶
func (recorder *DefaultRecorder) AppendMissingFieldErrorSignal(indent string, path string) Recorder
func (*DefaultRecorder) AppendNewLine ¶
func (recorder *DefaultRecorder) AppendNewLine() Recorder
func (*DefaultRecorder) AppendStartArray ¶
func (recorder *DefaultRecorder) AppendStartArray(indent string, jsonPath string) Recorder
func (*DefaultRecorder) AppendStartObject ¶
func (recorder *DefaultRecorder) AppendStartObject(indent string, jsonPath string) Recorder
func (*DefaultRecorder) AppendValidationErrorSignal ¶
func (recorder *DefaultRecorder) AppendValidationErrorSignal(message string) Recorder
func (*DefaultRecorder) AppendValue ¶
func (*DefaultRecorder) GetLog ¶
func (recorder *DefaultRecorder) GetLog() string
type Recorder ¶
type Recorder interface { AppendFieldName(indent string, fieldName string) Recorder AppendIgnoreField(indent string, jsonPath string) Recorder AppendValue(indent string, path string, value any, kind reflect.Kind) Recorder AppendValidationErrorSignal(message string) Recorder AppendMissingFieldErrorSignal(indent string, path string) Recorder AppendStartObject(indent string, path string) Recorder AppendEndObject(indent string, path string) Recorder AppendStartArray(indent string, path string) Recorder AppendEndArray(indent string, path string) Recorder AppendNewLine() Recorder GetLog() string }
Recorder is an interface that allows to create a human-readable output from the comparator's validation errors. The [Comparator] calls the methods below at different points during the validation. The use of a Recorder is entirely optional.
func NewDefaultRecorder ¶
func NewDefaultRecorder() Recorder
Click to show internal directories.
Click to hide internal directories.