validation

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MIT Imports: 16 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 ReportWriter 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 (kept for backwards compat with callers that still build options separately before constructing a ValidationRequest).

func WithOutput added in v0.5.0

func WithOutput(path string) Option

WithOutput sets the output path for the validation report.

type ReportWriter added in v0.6.0

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

ReportWriter defines how to write a validation report.

type Request added in v0.6.0

type Request struct {
	OcppContext ocpp.OcppContext // OCPP version, vendor, and model for schema selection
	Messages    []string         // inline messages to validate (mutually exclusive with File)
	File        string           // path to a newline-delimited file of messages
	Output      string           // optional path to write the report (.json, .csv, .txt)
}

Request carries all inputs for a single validation run.

type Service

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

func NewService

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

func (*Service) Validate added in v0.6.0

func (s *Service) Validate(req Request) (*report.Report, error)

Validate validates messages and returns the report. When vendor and/or model are set, the registry attempts vendor/model-specific schemas before falling back to the base OCPP spec schemas.

Jump to

Keyboard shortcuts

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