validator

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCannotCastToCallError = errors.New("cannot cast message to CallError")

Functions

This section is empty.

Types

type ValidationResult

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

func NewValidationResult

func NewValidationResult() *ValidationResult

NewValidationResult creates a new ValidationResult with the given validity and errors.

func (*ValidationResult) AddError

func (v *ValidationResult) AddError(err string)

func (*ValidationResult) Errors

func (v *ValidationResult) Errors() []string

Errors returns a list of errors collected during validation.

func (*ValidationResult) IsValid

func (v *ValidationResult) IsValid() bool

IsValid returns true if the validation result is valid, false otherwise.

type Validator

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

func NewValidator

func NewValidator(logger *zap.Logger, registry schema_registry.SchemaRegistry) *Validator

func (*Validator) ValidateMessage

func (v *Validator) ValidateMessage(ocppVersion ocpp.Version, message ocpp.Message) (*ValidationResult, error)

ValidateMessage validates the message. It checks if the message has an action, a payload, and a unique ID. It also validates the payload against the schema for the given action and OCPP version.

Jump to

Keyboard shortcuts

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