store

package
v0.0.0-...-55c65bb Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package store defines the interfaces to the persistent store.

Index

Constants

View Source
const (
	CacheModeAlways         = "ALWAYS"
	CacheModeAllowed        = "ALLOWED"
	CacheModeAllowedOffline = "ALLOWED_OFFLINE"
	CacheModeNever          = "NEVER"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CertificateInstallationStatus

type CertificateInstallationStatus string
var (
	CertificateInstallationPending  CertificateInstallationStatus = "Pending"
	CertificateInstallationAccepted CertificateInstallationStatus = "Accepted"
	CertificateInstallationRejected CertificateInstallationStatus = "Rejected"
)

type CertificateStore

type CertificateStore interface {
	SetCertificate(ctx context.Context, pemCertificate string) error
	LookupCertificate(ctx context.Context, certificateHash string) (string, error)
	DeleteCertificate(ctx context.Context, certificateHash string) error
}

type CertificateType

type CertificateType string
var (
	CertificateTypeChargeStation CertificateType = "ChargeStation"
	CertificateTypeEVCC          CertificateType = "EVCC"
	CertificateTypeV2G           CertificateType = "V2G"
	CertificateTypeMO            CertificateType = "MO"
	CertificateTypeMF            CertificateType = "MF"
	CertificateTypeCSMS          CertificateType = "CSMS"
)

type ChargeStationAuth

type ChargeStationAuth struct {
	SecurityProfile        SecurityProfile
	Base64SHA256Password   string
	InvalidUsernameAllowed bool
}

type ChargeStationAuthStore

type ChargeStationAuthStore interface {
	SetChargeStationAuth(ctx context.Context, chargeStationId string, auth *ChargeStationAuth) error
	LookupChargeStationAuth(ctx context.Context, chargeStationId string) (*ChargeStationAuth, error)
}

type ChargeStationInstallCertificate

type ChargeStationInstallCertificate struct {
	CertificateType               CertificateType
	CertificateId                 string
	CertificateData               string
	CertificateInstallationStatus CertificateInstallationStatus
	SendAfter                     time.Time
}

type ChargeStationInstallCertificates

type ChargeStationInstallCertificates struct {
	ChargeStationId string
	Certificates    []*ChargeStationInstallCertificate
}

type ChargeStationInstallCertificatesStore

type ChargeStationInstallCertificatesStore interface {
	UpdateChargeStationInstallCertificates(ctx context.Context, chargeStationId string, certificates *ChargeStationInstallCertificates) error
	LookupChargeStationInstallCertificates(ctx context.Context, chargeStationId string) (*ChargeStationInstallCertificates, error)
	ListChargeStationInstallCertificates(ctx context.Context, pageSize int, previousChargeStationId string) ([]*ChargeStationInstallCertificates, error)
}

type ChargeStationRuntimeDetails

type ChargeStationRuntimeDetails struct {
	OcppVersion string
}

type ChargeStationRuntimeDetailsStore

type ChargeStationRuntimeDetailsStore interface {
	SetChargeStationRuntimeDetails(ctx context.Context, chargeStationId string, details *ChargeStationRuntimeDetails) error
	LookupChargeStationRuntimeDetails(ctx context.Context, chargeStationId string) (*ChargeStationRuntimeDetails, error)
}

type ChargeStationSetting

type ChargeStationSetting struct {
	Value     string
	Status    ChargeStationSettingStatus
	SendAfter time.Time
}

type ChargeStationSettingStatus

type ChargeStationSettingStatus string
var (
	ChargeStationSettingStatusPending        ChargeStationSettingStatus = "Pending"
	ChargeStationSettingStatusAccepted       ChargeStationSettingStatus = "Accepted"
	ChargeStationSettingStatusRejected       ChargeStationSettingStatus = "Rejected"
	ChargeStationSettingStatusRebootRequired ChargeStationSettingStatus = "RebootRequired"
	ChargeStationSettingStatusNotSupported   ChargeStationSettingStatus = "NotSupported"
)

type ChargeStationSettings

type ChargeStationSettings struct {
	ChargeStationId string
	Settings        map[string]*ChargeStationSetting
}

type ChargeStationSettingsStore

type ChargeStationSettingsStore interface {
	UpdateChargeStationSettings(ctx context.Context, chargeStationId string, settings *ChargeStationSettings) error
	LookupChargeStationSettings(ctx context.Context, chargeStationId string) (*ChargeStationSettings, error)
	ListChargeStationSettings(ctx context.Context, pageSize int, previousChargeStationId string) ([]*ChargeStationSettings, error)
	DeleteChargeStationSettings(ctx context.Context, chargeStationId string) error
}

type ChargeStationTriggerMessage

type ChargeStationTriggerMessage struct {
	ChargeStationId string
	TriggerMessage  TriggerMessage
	TriggerStatus   TriggerStatus
	SendAfter       time.Time
}

type ChargeStationTriggerMessageStore

type ChargeStationTriggerMessageStore interface {
	SetChargeStationTriggerMessage(ctx context.Context, chargeStationId string, triggerMessage *ChargeStationTriggerMessage) error
	DeleteChargeStationTriggerMessage(ctx context.Context, chargeStationId string) error
	LookupChargeStationTriggerMessage(ctx context.Context, chargeStationId string) (*ChargeStationTriggerMessage, error)
	ListChargeStationTriggerMessages(ctx context.Context, pageSize int, previousChargeStationId string) ([]*ChargeStationTriggerMessage, error)
}

type Connector

type Connector struct {
	Format      string
	Id          string
	MaxAmperage int32
	MaxVoltage  int32
	PowerType   string
	Standard    string
	LastUpdated string
}

type Evse

type Evse struct {
	Connectors  []Connector
	EvseId      *string
	Status      string
	Uid         string
	LastUpdated string
}

type GeoLocation

type GeoLocation struct {
	Latitude  string
	Longitude string
}

type Location

type Location struct {
	Address     string
	City        string
	Coordinates GeoLocation
	Country     string
	Evses       *[]Evse
	Id          string
	LastUpdated string
	Name        string
	ParkingType string
	PostalCode  string
}

type LocationStore

type LocationStore interface {
	SetLocation(ctx context.Context, location *Location) error
	LookupLocation(ctx context.Context, locationId string) (*Location, error)
	ListLocations(context context.Context, offset int, limit int) ([]*Location, error)
}

type MeterValue

type MeterValue struct {
	SampledValues []SampledValue `firestore:"sampledValue"`
	Timestamp     string         `firestore:"timestamp"`
}

type OcpiParty

type OcpiParty struct {
	CountryCode string
	PartyId     string
	Role        string
	Url         string
	Token       string
}

type OcpiRegistration

type OcpiRegistration struct {
	Status OcpiRegistrationStatusType
}

type OcpiRegistrationStatusType

type OcpiRegistrationStatusType string
var (
	OcpiRegistrationStatusRegistered OcpiRegistrationStatusType = "registered"
	OcpiRegistrationStatusPending    OcpiRegistrationStatusType = "pending"
)

type OcpiStore

type OcpiStore interface {
	SetRegistrationDetails(ctx context.Context, token string, registration *OcpiRegistration) error
	GetRegistrationDetails(ctx context.Context, token string) (*OcpiRegistration, error)
	DeleteRegistrationDetails(ctx context.Context, token string) error

	SetPartyDetails(ctx context.Context, partyDetails *OcpiParty) error
	GetPartyDetails(ctx context.Context, role, countryCode, partyId string) (*OcpiParty, error)
	ListPartyDetailsForRole(ctx context.Context, role string) ([]*OcpiParty, error)
}

type SampledValue

type SampledValue struct {
	Context       *string        `firestore:"context"`
	Location      *string        `firestore:"location"`
	Measurand     *string        `firestore:"measurand"`
	Phase         *string        `firestore:"phase"`
	UnitOfMeasure *UnitOfMeasure `firestore:"unitOfMeasure"`
	Value         float64        `firestore:"value"`
}

type SecurityProfile

type SecurityProfile int8
const (
	UnsecuredTransportWithBasicAuth SecurityProfile = iota
	TLSWithBasicAuth
	TLSWithClientSideCertificates
)

type Token

type Token struct {
	CountryCode  string
	PartyId      string
	Type         string
	Uid          string
	ContractId   string
	VisualNumber *string
	Issuer       string
	GroupId      *string
	Valid        bool
	LanguageCode *string
	CacheMode    string
	LastUpdated  string
}

type TokenStore

type TokenStore interface {
	SetToken(ctx context.Context, token *Token) error
	LookupToken(ctx context.Context, tokenUid string) (*Token, error)
	ListTokens(context context.Context, offset int, limit int) ([]*Token, error)
}

type Transaction

type Transaction struct {
	ChargeStationId   string       `firestore:"chargeStationId"`
	TransactionId     string       `firestore:"transactionId"`
	IdToken           string       `firestore:"idToken"`
	TokenType         string       `firestore:"tokenType"`
	MeterValues       []MeterValue `firestore:"meterValues"`
	StartSeqNo        int          `firestore:"startSeqNo"`
	EndedSeqNo        int          `firestore:"endedSeqNo"`
	UpdatedSeqNoCount int          `firestore:"updatedSeqNoCount"`
	Offline           bool         `firestore:"offline"`
}

type TransactionStore

type TransactionStore interface {
	Transactions(ctx context.Context) ([]*Transaction, error)
	FindTransaction(ctx context.Context, chargeStationId, transactionId string) (*Transaction, error)
	CreateTransaction(ctx context.Context, chargeStationId, transactionId, idToken, tokenType string, meterValue []MeterValue, seqNo int, offline bool) error
	UpdateTransaction(ctx context.Context, chargeStationId, transactionId string, meterValue []MeterValue) error
	EndTransaction(ctx context.Context, chargeStationId, transactionId, idToken, tokenType string, meterValue []MeterValue, seqNo int) error
}

type TriggerMessage

type TriggerMessage string
var (
	TriggerMessageBootNotification                  TriggerMessage = "BootNotification"
	TriggerMessageHeartbeat                         TriggerMessage = "Heartbeat"
	TriggerMessageStatusNotification                TriggerMessage = "StatusNotification"
	TriggerMessageFirmwareStatusNotification        TriggerMessage = "FirmwareStatusNotification"
	TriggerMessageDiagnosticStatusNotification      TriggerMessage = "DiagnosticStatusNotification"
	TriggerMessageMeterValues                       TriggerMessage = "MeterValues"
	TriggerMessageSignChargingStationCertificate    TriggerMessage = "SignChargingStationCertificate"
	TriggerMessageSignV2GCertificate                TriggerMessage = "SignV2GCertificate"
	TriggerMessageSignCombinedCertificate           TriggerMessage = "SignCombinedCertificate"
	TriggerMessagePublishFirmwareStatusNotification TriggerMessage = "PublishFirmwareStatusNotification"
)

type TriggerStatus

type TriggerStatus string
var (
	TriggerStatusPending        TriggerStatus = "Pending"
	TriggerStatusAccepted       TriggerStatus = "Accepted"
	TriggerStatusRejected       TriggerStatus = "Rejected"
	TriggerStatusNotImplemented TriggerStatus = "NotImplemented"
)

type UnitOfMeasure

type UnitOfMeasure struct {
	Unit      string `firestore:"unit"`
	Multipler int    `firestore:"multipler"`
}

Directories

Path Synopsis
Package firestore provides an implementation of store.Engine using Google Firestore.
Package firestore provides an implementation of store.Engine using Google Firestore.
Package inmemory provides an in-memory implementation of store.Engine.
Package inmemory provides an in-memory implementation of store.Engine.

Jump to

Keyboard shortcuts

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