api: let Identify return multiple identities (#32949)
This commit is contained in:
parent
0ae85295dc
commit
0be2e0d803
51 changed files with 318 additions and 200 deletions
|
|
@ -130,9 +130,10 @@ type ChargeRater interface {
|
|||
ChargedEnergy() (float64, error)
|
||||
}
|
||||
|
||||
// Identifier identifies a vehicle and is implemented by the charger
|
||||
// Identifier identifies a vehicle and is implemented by the charger.
|
||||
// A charger may know more than one identity, e.g. an RFID tag and a vehicle id.
|
||||
type Identifier interface {
|
||||
Identify() (string, error)
|
||||
Identify() ([]string, error)
|
||||
}
|
||||
|
||||
// Authorizer authorizes a charging session by supplying RFID credentials
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ func (i *iDimmer) Dimmed() (bool, error) {
|
|||
return i.dimmer1()
|
||||
}
|
||||
|
||||
func Identifier(identifier0 func() (string, error)) api.Identifier {
|
||||
func Identifier(identifier0 func() ([]string, error)) api.Identifier {
|
||||
if identifier0 == nil {
|
||||
return nil
|
||||
}
|
||||
|
|
@ -236,10 +236,10 @@ func Identifier(identifier0 func() (string, error)) api.Identifier {
|
|||
}
|
||||
|
||||
type iIdentifier struct {
|
||||
identifier0 func() (string, error)
|
||||
identifier0 func() ([]string, error)
|
||||
}
|
||||
|
||||
func (i *iIdentifier) Identify() (string, error) {
|
||||
func (i *iIdentifier) Identify() ([]string, error) {
|
||||
return i.identifier0()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -396,10 +396,10 @@ func (m *MockIdentifier) EXPECT() *MockIdentifierMockRecorder {
|
|||
}
|
||||
|
||||
// Identify mocks base method.
|
||||
func (m *MockIdentifier) Identify() (string, error) {
|
||||
func (m *MockIdentifier) Identify() ([]string, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Identify")
|
||||
ret0, _ := ret[0].(string)
|
||||
ret0, _ := ret[0].([]string)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue