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.
Click to show internal directories.
Click to hide internal directories.