Documentation
¶
Index ¶
Constants ¶
View Source
const ( V15 = Version("1.5") V16 = Version("1.6") V20 = Version("2.0") V21 = Version("2.1") )
Variables ¶
This section is empty.
Functions ¶
func IsErrorCodeValid ¶
func IsValidProtocolVersion ¶
Types ¶
type Call ¶
type Call struct {
MessageTypeId MessageType `json:"messageTypeId" validate:"required,eq=2"`
UniqueId string `json:"uniqueId" validate:"required,max=36"`
Action string `json:"action" validate:"required,max=36"`
Payload interface{} `json:"payload" validate:"required"`
}
An OCPP-J Call message, containing an OCPP Request.
func (*Call) GetMessageTypeId ¶
func (call *Call) GetMessageTypeId() MessageType
func (*Call) GetPayload ¶
func (call *Call) GetPayload() interface{}
func (*Call) GetUniqueId ¶
type CallError ¶
type CallError struct {
MessageTypeId MessageType `json:"messageTypeId"`
UniqueId string `json:"uniqueId"`
ErrorCode ErrorCode `json:"errorCode"`
ErrorDescription string `json:"errorDescription"`
ErrorDetails interface{} `json:"errorDetails"`
}
An OCPP-J CallError message, containing an OCPP Error.
func (*CallError) GetMessageTypeId ¶
func (callError *CallError) GetMessageTypeId() MessageType
func (*CallError) GetPayload ¶
func (callError *CallError) GetPayload() interface{}
func (*CallError) GetUniqueId ¶
type CallResult ¶
type CallResult struct {
MessageTypeId MessageType `json:"messageTypeId"`
UniqueId string `json:"uniqueId"`
Payload interface{} `json:"payload"`
Action string `json:"action"`
}
An OCPP-J CallResult message, containing an OCPP Response.
func (*CallResult) GetAction ¶
func (callResult *CallResult) GetAction() string
func (*CallResult) GetMessageTypeId ¶
func (callResult *CallResult) GetMessageTypeId() MessageType
func (*CallResult) GetPayload ¶
func (callResult *CallResult) GetPayload() interface{}
func (*CallResult) GetUniqueId ¶
func (callResult *CallResult) GetUniqueId() string
type ErrorCode ¶
type ErrorCode string
const ( NotImplemented ErrorCode = "NotImplemented" // Requested Action is not known by receiver. NotSupported ErrorCode = "NotSupported" // Requested Action is recognized but not supported by the receiver. InternalError ErrorCode = "InternalError" // An internal error occurred and the receiver was not able to process the requested Action successfully. MessageTypeNotSupported ErrorCode = "MessageTypeNotSupported" // A message with a Message Type Number received that is not supported by this implementation. ProtocolError ErrorCode = "ProtocolError" // Payload for Action is incomplete. SecurityError ErrorCode = "SecurityError" // During the processing of Action a security issue occurred preventing receiver from completing the Action successfully. PropertyConstraintViolation ErrorCode = "PropertyConstraintViolation" // Payload is syntactically correct but at least one field contains an invalid value. OccurrenceConstraintViolationV2 ErrorCode = "OccurrenceConstraintViolation" // Payload for Action is syntactically correct but at least one of the fields violates occurrence constraints. OccurrenceConstraintViolationV16 ErrorCode = "OccurenceConstraintViolation" // Payload for Action is syntactically correct but at least one of the fields violates occurrence constraints. Contains a typo in OCPP 1.6 TypeConstraintViolation ErrorCode = "TypeConstraintViolation" // Payload for Action is syntactically correct but at least one of the fields violates data type constraints (e.g. “somestring”: 12). GenericError ErrorCode = "GenericError" // Any other error not covered by the previous ones. FormatViolationV2 ErrorCode = "FormatViolation" // Payload for Action is syntactically incorrect. This is only valid for OCPP 2.0.1 FormatViolationV16 ErrorCode = "FormationViolation" // Payload for Action is syntactically incorrect or not conform the PDU structure for Action. This is only valid for OCPP 1.6 )
func FormatErrorType ¶
type Message ¶
type Message interface {
// Returns the message type identifier of the message.
GetMessageTypeId() MessageType
GetPayload() interface{}
GetAction() string
GetUniqueId() string
}
An OCPP-J message.
type MessageType ¶
type MessageType int
MessageType identifies the type of message exchanged between two OCPP endpoints.
const ( CALL MessageType = 2 CALL_RESULT MessageType = 3 CALL_ERROR MessageType = 4 )
Click to show internal directories.
Click to hide internal directories.