How aasanchez/ocpp16messages works
Project type and purpose
• This is an open-source Go library (not a standalone application) that implements OCPP 1.6 messages.
• Purpose: Provide Go structs, constructors, validators and JSON marshalling/unmarshalling for OCPP 1.6 Authorize and BootNotification messages.
• Target audience: Go developers building EV charging station clients or central systems.
File structure
• Top-level files:
• go.mod, doc.go, README.md, Makefile, CI configs, etc.
• ocpp16messages.go likely contains package-level convenience functions
• Directories:
• /messages/authorize: request.go, confirmation.go, types/…, tests, docs, examples
• /messages/bootnotification: same pattern as authorize
• /shared/types: reusable types like CIString
• Pattern: each message type has its own sub-package with
– Request constructor
– Confirmation struct
– Nested types in types/
– Example tests demonstrating usage
• No transport layer here—network I/O is left to the integrator.
README for additional insights
• Describes OCPP and the two implemented messages.
• Shows usage: import message package, call Request(), marshal to JSON, send over a transport.
Detailed separation of components
• messages/authorize
• Request constructor
• Confirmation struct
• types (authorizationStatus, idTagInfo, idToken)
• messages/bootnotification
• Parallel structure
• shared/types
• CIString type and validation
• Top-level
• ocpp16messages.go (entry point)
• doc.go (package docs)