parser

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseJsonMessage

func ParseJsonMessage(dataJson string) ([]interface{}, error)

ParseJsonMessage Unmarshals an OCPP-J json object from a JSON string. Returns the array of elements contained in the message.

func ParseRawJsonMessage

func ParseRawJsonMessage(dataJson []byte) ([]interface{}, error)

ParseRawJsonMessage Unmarshals an OCPP-J json object from a byte array. Returns the array of elements contained in the message.

Types

type Parser

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

func NewParser

func NewParser(logger *zap.Logger) *Parser

func (*Parser) ParseMessage

func (p *Parser) ParseMessage(data string) (ocpp.Message, *Result, error)

type Result

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

func NewResult

func NewResult() *Result

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

func (*Result) AddError

func (v *Result) AddError(err string)

func (*Result) Errors

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

func (*Result) IsValid

func (v *Result) IsValid() bool

Jump to

Keyboard shortcuts

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