Initial cloud-services repo - gateway service + pkg modules
This commit is contained in:
53
pkg/db/queries/mocks/ecckeys.go
Normal file
53
pkg/db/queries/mocks/ecckeys.go
Normal file
@@ -0,0 +1,53 @@
|
||||
package mocks
|
||||
|
||||
import (
|
||||
"fiskerinc.com/modules/common"
|
||||
|
||||
"github.com/go-pg/pg/v10/orm"
|
||||
"github.com/jinzhu/copier"
|
||||
)
|
||||
|
||||
// EccKey query methods
|
||||
type MockEccKeys struct {
|
||||
DBMockHelper
|
||||
MockListResponse []common.ECCKeys
|
||||
MockEccKeys common.ECCKeys
|
||||
}
|
||||
|
||||
func (ek MockEccKeys) Insert(keys common.ECCKeys) (orm.Result, error) {
|
||||
return ek.ORMResponse, ek.Error
|
||||
}
|
||||
|
||||
func (ek MockEccKeys) SelectAllPrivateKeys() ([]common.ECCKeys, error) {
|
||||
return ek.MockListResponse, ek.Error
|
||||
}
|
||||
|
||||
func (ek MockEccKeys) SelectAllPrivateKeysByEnv(env string) ([]common.ECCKeys, error) {
|
||||
return ek.MockListResponse, ek.Error
|
||||
}
|
||||
|
||||
func (ek MockEccKeys) SelectPublicKeysByECUByEnv(ecu string, env string) (common.ECCKeys, error) {
|
||||
return ek.MockEccKeys, ek.Error
|
||||
}
|
||||
|
||||
func (ek MockEccKeys) SelectAllPublicKeysByEnv(env string) ([]common.ECCKeys, error) {
|
||||
return ek.MockListResponse, ek.Error
|
||||
}
|
||||
|
||||
func (ek MockEccKeys) SelectPrivateKeysByECUsEnv(ecus []string, env string) ([]common.ECCKeys, error) {
|
||||
result := []common.ECCKeys{}
|
||||
copier.Copy(&result, &ek.MockListResponse)
|
||||
return result, ek.Error
|
||||
}
|
||||
|
||||
func (ek MockEccKeys) SelectAllPrivateKeysByVIN(env string) ([]common.ECCKeys, error) {
|
||||
result := []common.ECCKeys{}
|
||||
copier.Copy(&result, &ek.MockListResponse)
|
||||
return result, ek.Error
|
||||
}
|
||||
|
||||
func (ek MockEccKeys) SelectAllPrivateKeysByCarUpdateID(id int64) ([]common.ECCKeys, error) {
|
||||
result := []common.ECCKeys{}
|
||||
copier.Copy(&result, &ek.MockListResponse)
|
||||
return result, ek.Error
|
||||
}
|
||||
Reference in New Issue
Block a user