MSP-8299 - move test
This commit is contained in:
1 parent
a2e6e48c46
commit
d241c0356e
4 files changed
+296
-251
No files matched your search
+19
-5
@@ -4,18 +4,32 @@ import (
|
||||
"encoding/json"
|
||||
|
||||
"ispctl/model"
|
||||
"ispctl/repository"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/txix-open/isp-kit/rc/schema"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
enableUnsafe bool
|
||||
configRepo repository.Config
|
||||
// configRepo is the config-service API surface consumed by Config. It is an
|
||||
// interface so tests can substitute a fake; production passes the concrete
|
||||
// repository.Config, which satisfies it.
|
||||
type configRepo interface {
|
||||
GetAvailableConfigs() ([]model.ModuleInfo, error)
|
||||
GetAuditModules() ([]model.AuditModule, error)
|
||||
GetConfigByModuleName(name string) (*model.Config, error)
|
||||
CreateUpdateConfig(request model.Config) (*model.Config, error)
|
||||
GetSchemaByModuleId(moduleId string) (*model.ConfigSchema, error)
|
||||
GetAllVariables() ([]model.Variable, error)
|
||||
GetVariableByName(variableName string) (*model.Variable, error)
|
||||
UpsertVariables(request []model.UpsertVariableRequest) error
|
||||
DeleteVariable(variableName string) error
|
||||
}
|
||||
|
||||
func NewConfig(enableUnsafe bool, configRepo repository.Config) Config {
|
||||
type Config struct {
|
||||
enableUnsafe bool
|
||||
configRepo configRepo
|
||||
}
|
||||
|
||||
func NewConfig(enableUnsafe bool, configRepo configRepo) Config {
|
||||
return Config{
|
||||
enableUnsafe: enableUnsafe,
|
||||
configRepo: configRepo,
|
||||
|
||||
Reference in new issue
Block a user