validation

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteReport added in v0.5.0

func WriteReport(path string, r *report.Report) error

WriteReport is a convenience exported helper that writes the report using the appropriate OutputStrategy based on the provided path extension.

Types

type Option added in v0.5.0

type Option func(*options)

Option is a functional option for ValidateFile.

func WithOutput added in v0.5.0

func WithOutput(path string) Option

WithOutput sets the output path for the validation report.

type OutputStrategy added in v0.5.0

type OutputStrategy interface {
	Write(path string, r *report.Report) error
}

OutputStrategy defines how to write a validation report.

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(
	logger *zap.Logger,
	registry schema_registry.SchemaRegistry,
) *Service

func (*Service) ValidateFile

func (s *Service) ValidateFile(file string, ocppVersion ocpp.Version, opts ...Option) error

ValidateFile validates a file containing multiple OCPP messages against the schema. It accepts optional Option(s). If an output option is provided, the report will be written using a strategy based on the output file extension. If no options are provided, behavior is unchanged and results are logged to console.

func (*Service) ValidateFileWithReport added in v0.5.0

func (s *Service) ValidateFileWithReport(file string, ocppVersion ocpp.Version) (*report.Report, error)

ValidateFileWithReport validates the file and returns the generated report. This is used by the CLI when an output file path is requested.

func (*Service) ValidateMessage

func (s *Service) ValidateMessage(message string, ocppVersion ocpp.Version) error

ValidateMessage validates a single OCPP message against the schema.

func (*Service) ValidateMessageWithReport added in v0.5.0

func (s *Service) ValidateMessageWithReport(message string, ocppVersion ocpp.Version) (*report.Report, error)

ValidateMessageWithReport validates the message and returns the generated report. This is used by the CLI when an output file path is requested.

Jump to

Keyboard shortcuts

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