localauth

package
Version: 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

Contains features to manage the local authorization list in Charge Points.

Index

Constants

View Source
const (
	UpdateTypeDifferential      UpdateType   = "Differential"
	UpdateTypeFull              UpdateType   = "Full"
	UpdateStatusAccepted        UpdateStatus = "Accepted"
	UpdateStatusFailed          UpdateStatus = "Failed"
	UpdateStatusNotSupported    UpdateStatus = "NotSupported"
	UpdateStatusVersionMismatch UpdateStatus = "VersionMismatch"
)
View Source
const GetLocalListVersionFeatureName = "GetLocalListVersion"
View Source
const ProfileName = "localAuthList"

The profile name

View Source
const SendLocalListFeatureName = "SendLocalList"

Variables

Provides support for managing the local authorization list in Charge Points.

Functions

This section is empty.

Types

type AuthorizationData

type AuthorizationData struct {
	IdTag     string           `json:"idTag" validate:"required,max=20"`
	IdTagInfo *types.IdTagInfo `json:"idTagInfo,omitempty"` //TODO: validate required if update type is Full
}

type CentralSystemHandler

type CentralSystemHandler interface {
}

Needs to be implemented by Central systems for handling messages part of the OCPP 1.6 LocalAuthList profile.

type ChargePointHandler

type ChargePointHandler interface {
	OnGetLocalListVersion(request *GetLocalListVersionRequest) (confirmation *GetLocalListVersionConfirmation, err error)
	OnSendLocalList(request *SendLocalListRequest) (confirmation *SendLocalListConfirmation, err error)
}

Needs to be implemented by Charge points for handling messages part of the OCPP 1.6 LocalAuthList profile.

type GetLocalListVersionConfirmation

type GetLocalListVersionConfirmation struct {
	ListVersion int `json:"listVersion" validate:"gte=-1"`
}

This field definition of the GetLocalListVersion confirmation payload, sent by the Charge Point to the Central System in response to a GetLocalListVersionRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewGetLocalListVersionConfirmation

func NewGetLocalListVersionConfirmation(version int) *GetLocalListVersionConfirmation

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

func (GetLocalListVersionConfirmation) GetFeatureName

func (c GetLocalListVersionConfirmation) GetFeatureName() string

type GetLocalListVersionFeature

type GetLocalListVersionFeature struct{}

Central System can request a Charge Point for the version number of the Local Authorization List. The Central System SHALL send a GetLocalListVersionRequest to request this value. Upon receipt of a GetLocalListVersionRequest, the Charge Point SHALL respond with a GetLocalListVersionConfirmation. The response payload SHALL contain the version number of its Local Authorization List. A version number of 0 (zero) SHALL be used to indicate that the local authorization list is empty, and a version number of -1 SHALL be used to indicate that the Charge Point does not support Local Authorization Lists.

func (GetLocalListVersionFeature) GetFeatureName

func (f GetLocalListVersionFeature) GetFeatureName() string

func (GetLocalListVersionFeature) GetRequestType

func (f GetLocalListVersionFeature) GetRequestType() reflect.Type

func (GetLocalListVersionFeature) GetResponseType

func (f GetLocalListVersionFeature) GetResponseType() reflect.Type

type GetLocalListVersionRequest

type GetLocalListVersionRequest struct {
}

The field definition of the GetLocalListVersion request payload sent by the Central System to the Charge Point.

func NewGetLocalListVersionRequest

func NewGetLocalListVersionRequest() *GetLocalListVersionRequest

Creates a new GetLocalListVersionRequest, which doesn't contain any required or optional fields.

func (GetLocalListVersionRequest) GetFeatureName

func (r GetLocalListVersionRequest) GetFeatureName() string

type SendLocalListConfirmation

type SendLocalListConfirmation struct {
	Status UpdateStatus `json:"status" validate:"required,updateStatus"`
}

This field definition of the SendLocalList confirmation payload, sent by the Charge Point to the Central System in response to a SendLocalListRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewSendLocalListConfirmation

func NewSendLocalListConfirmation(status UpdateStatus) *SendLocalListConfirmation

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

func (SendLocalListConfirmation) GetFeatureName

func (c SendLocalListConfirmation) GetFeatureName() string

type SendLocalListFeature

type SendLocalListFeature struct{}

Central System can send a Local Authorization List that a Charge Point can use for authorization of idTags. The list MAY be either a full list to replace the current list in the Charge Point or it MAY be a differential list with updates to be applied to the current list in the Charge Point. Upon receipt of a SendLocalListRequest the Charge Point SHALL respond with a SendLocalListConfirmation. The Central System SHALL send a SendLocalListRequest to send the list to a Charge Point. The request payload SHALL contain the type of update (full or differential) and the version number that the Charge Point MUST associate with the local authorization list after it has been updated. The response payload SHALL indicate whether the Charge Point has accepted the update of the local authorization list. If the status is Failed or VersionMismatch and the updateType was Differential, then Central System SHOULD retry sending the full local authorization list with updateType Full.

func (SendLocalListFeature) GetFeatureName

func (f SendLocalListFeature) GetFeatureName() string

func (SendLocalListFeature) GetRequestType

func (f SendLocalListFeature) GetRequestType() reflect.Type

func (SendLocalListFeature) GetResponseType

func (f SendLocalListFeature) GetResponseType() reflect.Type

type SendLocalListRequest

type SendLocalListRequest struct {
	ListVersion            int                 `json:"listVersion" validate:"gte=0"`
	LocalAuthorizationList []AuthorizationData `json:"localAuthorizationList,omitempty" validate:"omitempty,dive"`
	UpdateType             UpdateType          `json:"updateType" validate:"required,updateType"`
}

The field definition of the SendLocalList request payload sent by the Central System to the Charge Point. If no (empty) localAuthorizationList is given and the updateType is Full, all identifications are removed from the list.

Requesting a Differential update without (empty) localAuthorizationList will have no effect on the list. All idTags in the localAuthorizationList MUST be unique, no duplicate values are allowed.

func NewSendLocalListRequest

func NewSendLocalListRequest(version int, updateType UpdateType) *SendLocalListRequest

Creates a new SendLocalListRequest, containing all required field. Optional fields may be set afterwards.

func (SendLocalListRequest) GetFeatureName

func (r SendLocalListRequest) GetFeatureName() string

type UpdateStatus

type UpdateStatus string

type UpdateType

type UpdateType string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL