reservation

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

The reservation functional block contains OCPP 2.0 features that enable EV drivers to make and manage reservations of charging stations.

Index

Constants

View Source
const CancelReservationFeatureName = "CancelReservation"
View Source
const ProfileName = "reservation"

Variables

Functions

This section is empty.

Types

type CSMSHandler

type CSMSHandler interface {
}

Needs to be implemented by a CSMS for handling messages part of the OCPP 2.0 Reservation profile.

type CancelReservationFeature

type CancelReservationFeature struct{}

To cancel a reservation the CSMS SHALL send an CancelReservationRequest to the Charging Station. If the Charging Station has a reservation matching the reservationId in the request payload, it SHALL return status ‘Accepted’. Otherwise it SHALL return ‘Rejected’.

func (CancelReservationFeature) GetFeatureName

func (f CancelReservationFeature) GetFeatureName() string

func (CancelReservationFeature) GetRequestType

func (f CancelReservationFeature) GetRequestType() reflect.Type

func (CancelReservationFeature) GetResponseType

func (f CancelReservationFeature) GetResponseType() reflect.Type

type CancelReservationRequest

type CancelReservationRequest struct {
	ReservationId int `json:"reservationId" validate:"gte=0"`
}

The field definition of the CancelReservation request payload sent by the CSMS to the Charging Station.

func NewCancelReservationRequest

func NewCancelReservationRequest(reservationId int) *CancelReservationRequest

Creates a new CancelReservationRequest, containing all required fields. There are no optional fields for this message.

func (CancelReservationRequest) GetFeatureName

func (r CancelReservationRequest) GetFeatureName() string

type CancelReservationResponse

type CancelReservationResponse struct {
	Status CancelReservationStatus `json:"status" validate:"required,cancelReservationStatus"`
}

This field definition of the CancelReservation response payload, sent by the Charging Station to the CSMS in response to a CancelReservationRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewCancelReservationResponse

func NewCancelReservationResponse(status CancelReservationStatus) *CancelReservationResponse

Creates a new CancelReservationResponse, containing all required fields. There are no optional fields for this message.

func (CancelReservationResponse) GetFeatureName

func (c CancelReservationResponse) GetFeatureName() string

type CancelReservationStatus

type CancelReservationStatus string

Status reported in CancelReservationResponse.

const (
	CancelReservationStatusAccepted CancelReservationStatus = "Accepted"
	CancelReservationStatusRejected CancelReservationStatus = "Rejected"
)

type ChargingStationHandler

type ChargingStationHandler interface {
	// OnCancelReservation is called on a charging station whenever a CancelReservationRequest is received from the CSMS.
	OnCancelReservation(request *CancelReservationRequest) (confirmation *CancelReservationResponse, err error)
}

Needs to be implemented by Charging stations for handling messages part of the OCPP 2.0 Reservation profile.

Jump to

Keyboard shortcuts

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