Versions in this module Expand all Collapse all v0 v0.1.3 Oct 19, 2026 v0.1.2 Oct 19, 2026 v0.1.1 Oct 18, 2026 v0.1.0 Oct 18, 2026 Changes in this version + var ErrBusy = errors.New("ocpp: busy") + var ErrClosed = errors.New("ocpp: closed") + var ErrConnectFailed = errors.New("ocpp: connect failed") + var ErrConnectionLost = errors.New("ocpp: connection lost") + var ErrHandlerPanic = errors.New("ocpp: handler panic") + var ErrInvalidMessage = errors.New("ocpp: invalid message") + var ErrInvalidOption = errors.New("ocpp: invalid option") + var ErrNotConnected = errors.New("ocpp: not connected") + var ErrProtocol = errors.New("ocpp: protocol error") + var ErrTimeout = errors.New("ocpp: timeout") + var ErrUnexpectedResponse = errors.New("ocpp: unexpected response") + var ErrUnsupportedVersion = errors.New("ocpp: unsupported version") + var ErrWrongDirection = errors.New("ocpp: action not sent in this direction") + func AfterResponse(ctx context.Context, f func()) bool + func Ptr[T any](v T) *T + type CallError struct + Code ErrorCode + Description string + Details json.RawMessage + func NewCallError(code ErrorCode, description string) *CallError + func (e *CallError) Error() string + type CallInfo struct + Action string + Direction Direction + MessageID string + type Caller interface + Call func(ctx context.Context, action string, req, resp any) error + type CloseError struct + Code int + Reason string + func (e *CloseError) Error() string + func (e *CloseError) Normal() bool + type ConnInfo struct + Role Role + SessionID string + StationID string + Version Version + type Direction uint8 + const Incoming + const Outgoing + func (d Direction) String() string + type Dispatcher interface + Dispatch func(ctx context.Context, p Peer, action string, payload json.RawMessage) (json.RawMessage, error) + type DispatcherFunc func(ctx context.Context, p Peer, action string, payload json.RawMessage) (json.RawMessage, error) + func (f DispatcherFunc) Dispatch(ctx context.Context, p Peer, action string, payload json.RawMessage) (json.RawMessage, error) + type ErrorCode string + const FormatViolation + const FormationViolation + const GenericError + const InternalError + const MessageTypeNotSupported + const NotImplemented + const NotSupported + const OccurenceConstraintViolation + const OccurrenceConstraintViolation + const PropertyConstraintViolation + const ProtocolError + const RpcFrameworkError + const SecurityError + const TypeConstraintViolation + type FrameObserver func(info ConnInfo, dir Direction, frame []byte) + type Interceptor func(ctx context.Context, info CallInfo, next func(context.Context) error) error + type Metrics interface + OnCallDone func(info ConnInfo, action string, d time.Duration, err error) + OnCallHandled func(info ConnInfo, action string, d time.Duration, err error) + OnConnect func(info ConnInfo) + OnConnectFailed func(info ConnInfo, err error) + OnDisconnect func(info ConnInfo, err error) + OnProtocolError func(info ConnInfo, err error) + OnReconnectAttempt func(info ConnInfo, attempt int) + type NopMetrics struct + func (NopMetrics) OnCallDone(ConnInfo, string, time.Duration, error) + func (NopMetrics) OnCallHandled(ConnInfo, string, time.Duration, error) + func (NopMetrics) OnConnect(ConnInfo) + func (NopMetrics) OnConnectFailed(ConnInfo, error) + func (NopMetrics) OnDisconnect(ConnInfo, error) + func (NopMetrics) OnProtocolError(ConnInfo, error) + func (NopMetrics) OnReconnectAttempt(ConnInfo, int) + type Peer interface + ID func() string + Version func() Version + type Role uint8 + const CSMS + const ChargingStation + func (r Role) String() string + type SendDispatcher interface + DispatchSend func(ctx context.Context, p Peer, action string, payload json.RawMessage) error + type Sender interface + Send func(ctx context.Context, action string, req any) error + type State uint8 + const Closed + const Connected + const Connecting + const Disconnected + func (s State) String() string + type ValidationError struct + Code ErrorCode + Field string + Reason string + func (e *ValidationError) CallError() *CallError + func (e *ValidationError) Error() string + func (e *ValidationError) Unwrap() error + type Version uint8 + const V16 + const V201 + const V21 + func ParseSubprotocol(s string) (Version, bool) + func ParseVersion(s string) (Version, bool) + func Versions() []Version + func (v Version) String() string + func (v Version) Subprotocol() string + func (v Version) Valid() bool