Initial cloud-services repo - gateway service + pkg modules

This commit is contained in:
Chris Rai
2026-01-30 23:14:52 -05:00
commit fbb820d7b3
1037 changed files with 171318 additions and 0 deletions

28
pkg/cache/car_dtcs.go vendored Normal file
View File

@@ -0,0 +1,28 @@
package cache
import (
"fiskerinc.com/modules/common"
)
type CarDTCsCacheInterface interface {
Exists(dtc common.DTC_ECU) bool
Set(dtc common.DTC_ECU)
}
type CarDTCsCache struct {
ringMap *RingMap
}
func NewCarDTCsCache(capacity int) CarDTCsCacheInterface {
return &CarDTCsCache{
ringMap: NewRingMap(capacity),
}
}
func (carDtcCache *CarDTCsCache) Exists(dtc common.DTC_ECU) bool {
return carDtcCache.ringMap.Exists(dtc.CacheKey(), dtc.StatusByte)
}
func (carDtcCache *CarDTCsCache) Set(dtc common.DTC_ECU) {
carDtcCache.ringMap.Put(dtc.CacheKey(), dtc.StatusByte)
}