feat(config): Write and read config + refacto
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@ -7,6 +7,6 @@ import (
|
||||
)
|
||||
|
||||
// GetInitializeUserInput will ask user to provide information that allow initialization of a project.
|
||||
func (a APIType) GetInitializeUserInput(params *models.UserInputParams) (*models.UserInputParams, error) {
|
||||
func (a APIType) GetInitializeUserInput(params *models.Config) (*models.Config, error) {
|
||||
return nil, errors.NotImplementedf("GetInitializeUserInput not implemented for %s", a.GetName())
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
// GetInitializeUserInput will ask user to provide information that allow initialization of a project.
|
||||
func (a APIType) GetInitializeUserInput(params *models.UserInputParams) (*models.UserInputParams, error) {
|
||||
func (a APIType) GetInitializeUserInput(params *models.Config) (*models.Config, error) {
|
||||
log.Debugf("Starting %s user input", a.GetName())
|
||||
|
||||
// Get current path
|
||||
@ -33,11 +33,11 @@ func (a APIType) GetInitializeUserInput(params *models.UserInputParams) (*models
|
||||
log.Debug("We are not in GoPath, ask extra info")
|
||||
goModulePath := helpers.StringInput()
|
||||
log.Info("Go Module name:")
|
||||
params.GoModuleName = &goModulePath
|
||||
params.ModuleName = &goModulePath
|
||||
}
|
||||
|
||||
log.Info("Do you want to enable database models auto generation ?")
|
||||
params.DatabaseModels = helpers.YesOrNoInput()
|
||||
params.Features.DatabaseModels.Enabled = helpers.YesOrNoInput()
|
||||
|
||||
return params, nil
|
||||
}
|
||||
|
@ -6,5 +6,5 @@ import "git.home.m-and-m.ovh/mderasse/gouick/helpers/models"
|
||||
type APITypeInterface interface {
|
||||
CheckInitialize() error
|
||||
GetName() models.APITypeName
|
||||
GetInitializeUserInput(params *models.UserInputParams) (*models.UserInputParams, error)
|
||||
GetInitializeUserInput(params *models.Config) (*models.Config, error)
|
||||
}
|
||||
|
Reference in New Issue
Block a user