Skip to content
This repository was archived by the owner on Jun 29, 2024. It is now read-only.

Major refactoring #19

Merged
merged 26 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d54e409
Refactor
DerAndereAndi Feb 18, 2024
9d1759b
Update eebus
DerAndereAndi Feb 18, 2024
f9e6366
Add another usecase, move tests, some cleanup
DerAndereAndi Feb 19, 2024
9bb7c63
Update spine, eebus and fix build
DerAndereAndi Feb 19, 2024
12e7760
Move all emobility usecases into new structure
DerAndereAndi Feb 22, 2024
da4fc01
Fix build
DerAndereAndi Feb 22, 2024
1cead6c
Fix tests
DerAndereAndi Feb 22, 2024
c647b78
Update spine and eebus
DerAndereAndi Feb 22, 2024
e193c0d
Fix issues and improve test coverage of UCCEVC
DerAndereAndi Feb 22, 2024
49e5159
Add missing tests
DerAndereAndi Feb 22, 2024
074f64d
add minor comment
DerAndereAndi Feb 23, 2024
19b5f3f
UCEVCC updates and test coverage
DerAndereAndi Feb 23, 2024
e379a8e
Update UCEVCEM tess and fix measurement issue
DerAndereAndi Feb 23, 2024
8456a98
Update UCEVSECC and tests
DerAndereAndi Feb 23, 2024
e117a95
Update UCEVSoC
DerAndereAndi Feb 23, 2024
fe37eef
Some renaming and tests for UCOPEV
DerAndereAndi Feb 23, 2024
70279d2
UCOSCEV api renaming and added tests
DerAndereAndi Feb 23, 2024
5426d59
Fix codefactor issues
DerAndereAndi Feb 23, 2024
e060b84
Add tests for util package and remove unused code
DerAndereAndi Feb 23, 2024
f3abcce
Minor refactor
DerAndereAndi Feb 23, 2024
b80fb1e
Add MGCP use case
DerAndereAndi Feb 23, 2024
7efe369
Minor code update to MGCP
DerAndereAndi Feb 23, 2024
e8b516e
Add VAPD use case
DerAndereAndi Feb 23, 2024
8a8742f
Fix wrong or missing features, functions, tests
DerAndereAndi Feb 24, 2024
edfeb85
Add VABD
DerAndereAndi Feb 24, 2024
4f95add
Remove rest of old APIs
DerAndereAndi Feb 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ jobs:
skip-build-cache: true

- name: Test
run: go test -race -v -coverprofile=coverage.out -covermode=atomic ./...
run: go test -race -v -coverprofile=coverage_temp.out -covermode=atomic ./...

- name: Remove mocks and cmd from coverage
run: grep -v -e "/cemd/mocks/" -e "/cemd/cmd/" coverage_temp.out > coverage.out

- name: Send coverage
uses: coverallsapp/github-action@v2
Expand Down
10 changes: 10 additions & 0 deletions .mockery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
with-expecter: true
inpackage: false
dir: "{{ .InterfaceDir }}/mocks/"
mockname: "{{.InterfaceName}}"
outpkg: "mocks"
filename: "{{.InterfaceName}}.go"
all: true
packages:
github.com/enbility/cemd/api:
github.com/enbility/cemd/evsecc:
53 changes: 47 additions & 6 deletions api/api.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,54 @@
package api

import (
shipapi "github.com/enbility/ship-go/api"
spineapi "github.com/enbility/spine-go/api"
"github.com/enbility/spine-go/model"
)

// Implemented by *Solutions, used by Cem
type SolutionInterface interface {
RegisterRemoteDevice(details *shipapi.ServiceDetails, dataProvider any) any
UnRegisterRemoteDevice(remoteDeviceSki string)
//go:generate mockery

// Implemented by CEM
type CemInterface interface {
// Setup the EEBUS service
Setup() error

// Start the EEBUS service
Start()

// Shutdown the EEBUS service
Shutdown()

// Add a use case implementation
AddUseCase(usecase UseCaseInterface)
}

// Implemented by each UseCase
type UseCaseInterface interface {
// provide the usecase name
UseCaseName() model.UseCaseNameType

// add the features
AddFeatures()
AddUseCases()

// add the usecase
AddUseCase()

// returns if the entity supports the usecase
//
// possible errors:
// - ErrDataNotAvailable if that information is not (yet) available
// - and others
IsUseCaseSupported(remoteEntity spineapi.EntityRemoteInterface) (bool, error)
}

// interface for informing the cem about specific events
// for each supported usecase
//
// UseCaseEventType values can be found in the api definition of each
// supported usecase
//
// implemented by the actual CEM, used by UCEvseCCInterface implementation
type UseCaseEventReaderInterface interface {
// Inform about a new usecase specific event
SpineEvent(ski string, entity spineapi.EntityRemoteInterface, event UseCaseEventType)
}
Loading
Loading