recorder

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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 (recorder *DefaultRecorder) AppendValue(indent string, jsonPath string, value any, kind reflect.Kind) Recorder

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

Jump to

Keyboard shortcuts

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