Documentation
¶
Index ¶
- func WriteReport(path string, r *report.Report) error
- type Option
- type OutputStrategy
- type Service
- func (s *Service) ValidateFile(file string, ocppVersion ocpp.Version, opts ...Option) error
- func (s *Service) ValidateFileWithReport(file string, ocppVersion ocpp.Version) (*report.Report, error)
- func (s *Service) ValidateMessage(message string, ocppVersion ocpp.Version) error
- func (s *Service) ValidateMessageWithReport(message string, ocppVersion ocpp.Version) (*report.Report, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
WithOutput sets the output path for the validation report.
type OutputStrategy ¶ added in v0.5.0
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 ¶
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 ¶
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.