inmemory

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: 14 Imported by: 0

Documentation

Overview

Package inmemory provides an in-memory implementation of store.Engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Store is an in-memory implementation of the store.Engine interface. As everything is stored in memory it is not stateless and cannot be used if running >1 manager instances. It is primarily provided to support unit testing.

func NewStore

func NewStore(clock clock.PassiveClock) *Store

func (*Store) CreateTransaction

func (s *Store) CreateTransaction(_ context.Context, chargeStationId, transactionId, idToken, tokenType string, meterValues []store.MeterValue, seqNo int, offline bool) error

func (*Store) DeleteCertificate

func (s *Store) DeleteCertificate(_ context.Context, certificateHash string) error

func (*Store) DeleteChargeStationSettings

func (s *Store) DeleteChargeStationSettings(_ context.Context, chargeStationId string) error

func (*Store) DeleteChargeStationTriggerMessage

func (s *Store) DeleteChargeStationTriggerMessage(ctx context.Context, chargeStationId string) error

func (*Store) DeleteRegistrationDetails

func (s *Store) DeleteRegistrationDetails(_ context.Context, token string) error

func (*Store) EndTransaction

func (s *Store) EndTransaction(_ context.Context, chargeStationId, transactionId, idToken, tokenType string, meterValues []store.MeterValue, seqNo int) error

func (*Store) FindTransaction

func (s *Store) FindTransaction(_ context.Context, chargeStationId, transactionId string) (*store.Transaction, error)

func (*Store) GetPartyDetails

func (s *Store) GetPartyDetails(_ context.Context, role, countryCode, partyId string) (*store.OcpiParty, error)

func (*Store) GetRegistrationDetails

func (s *Store) GetRegistrationDetails(_ context.Context, token string) (*store.OcpiRegistration, error)

func (*Store) ListChargeStationInstallCertificates

func (s *Store) ListChargeStationInstallCertificates(_ context.Context, pageSize int, previousChargeStationId string) ([]*store.ChargeStationInstallCertificates, error)

func (*Store) ListChargeStationSettings

func (s *Store) ListChargeStationSettings(_ context.Context, pageSize int, previousChargeStationId string) ([]*store.ChargeStationSettings, error)

func (*Store) ListChargeStationTriggerMessages

func (s *Store) ListChargeStationTriggerMessages(ctx context.Context, pageSize int, previousChargeStationId string) ([]*store.ChargeStationTriggerMessage, error)

func (*Store) ListLocations

func (s *Store) ListLocations(_ context.Context, offset int, limit int) ([]*store.Location, error)

func (*Store) ListPartyDetailsForRole

func (s *Store) ListPartyDetailsForRole(_ context.Context, role string) ([]*store.OcpiParty, error)

func (*Store) ListTokens

func (s *Store) ListTokens(_ context.Context, offset int, limit int) ([]*store.Token, error)

func (*Store) LookupCertificate

func (s *Store) LookupCertificate(_ context.Context, certificateHash string) (string, error)

func (*Store) LookupChargeStationAuth

func (s *Store) LookupChargeStationAuth(_ context.Context, chargeStationId string) (*store.ChargeStationAuth, error)

func (*Store) LookupChargeStationInstallCertificates

func (s *Store) LookupChargeStationInstallCertificates(_ context.Context, chargeStationId string) (*store.ChargeStationInstallCertificates, error)

func (*Store) LookupChargeStationRuntimeDetails

func (s *Store) LookupChargeStationRuntimeDetails(_ context.Context, chargeStationId string) (*store.ChargeStationRuntimeDetails, error)

func (*Store) LookupChargeStationSettings

func (s *Store) LookupChargeStationSettings(_ context.Context, chargeStationId string) (*store.ChargeStationSettings, error)

func (*Store) LookupChargeStationTriggerMessage

func (s *Store) LookupChargeStationTriggerMessage(ctx context.Context, chargeStationId string) (*store.ChargeStationTriggerMessage, error)

func (*Store) LookupLocation

func (s *Store) LookupLocation(_ context.Context, locationId string) (*store.Location, error)

func (*Store) LookupToken

func (s *Store) LookupToken(_ context.Context, tokenUid string) (*store.Token, error)

func (*Store) SetCertificate

func (s *Store) SetCertificate(_ context.Context, pemCertificate string) error

func (*Store) SetChargeStationAuth

func (s *Store) SetChargeStationAuth(_ context.Context, chargeStationId string, auth *store.ChargeStationAuth) error

func (*Store) SetChargeStationRuntimeDetails

func (s *Store) SetChargeStationRuntimeDetails(_ context.Context, chargeStationId string, details *store.ChargeStationRuntimeDetails) error

func (*Store) SetChargeStationTriggerMessage

func (s *Store) SetChargeStationTriggerMessage(ctx context.Context, chargeStationId string, triggerMessage *store.ChargeStationTriggerMessage) error

func (*Store) SetLocation

func (s *Store) SetLocation(_ context.Context, location *store.Location) error

func (*Store) SetPartyDetails

func (s *Store) SetPartyDetails(_ context.Context, partyDetails *store.OcpiParty) error

func (*Store) SetRegistrationDetails

func (s *Store) SetRegistrationDetails(_ context.Context, token string, registration *store.OcpiRegistration) error

func (*Store) SetToken

func (s *Store) SetToken(_ context.Context, token *store.Token) error

func (*Store) Transactions

func (s *Store) Transactions(_ context.Context) ([]*store.Transaction, error)

func (*Store) UpdateChargeStationInstallCertificates

func (s *Store) UpdateChargeStationInstallCertificates(_ context.Context, chargeStationId string, certificates *store.ChargeStationInstallCertificates) error

func (*Store) UpdateChargeStationSettings

func (s *Store) UpdateChargeStationSettings(_ context.Context, chargeStationId string, settings *store.ChargeStationSettings) error

func (*Store) UpdateTransaction

func (s *Store) UpdateTransaction(_ context.Context, chargeStationId, transactionId string, meterValues []store.MeterValue) error

Jump to

Keyboard shortcuts

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