feat(apiType): Start to implement apiType system
This commit is contained in:
14
cmd/init.go
14
cmd/init.go
@ -6,8 +6,10 @@ package cmd
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"git.home.m-and-m.ovh/mderasse/boot/helpers"
|
||||
"git.home.m-and-m.ovh/mderasse/boot/helpers/api_type"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
@ -40,7 +42,7 @@ func runInitAction(cmd *cobra.Command, args []string) {
|
||||
|
||||
log.Debugf("Starting command Init")
|
||||
|
||||
log.Debugf("Checking dependecies")
|
||||
log.Debugf("Checking dependencies")
|
||||
|
||||
if !checkDependencies() {
|
||||
return
|
||||
@ -83,6 +85,16 @@ func runInitAction(cmd *cobra.Command, args []string) {
|
||||
return
|
||||
}
|
||||
|
||||
// ask which API type we want to use
|
||||
var possibleApiTypes []string
|
||||
for _, apiType := range api_type.GetListOfApiTypeName() {
|
||||
possibleApiTypes = append(possibleApiTypes, string(apiType))
|
||||
}
|
||||
|
||||
log.Infof("Which kind of API do you want to init (possible values: %s)", strings.Join(possibleApiTypes, ", "))
|
||||
apiType := helpers.ApiTypeInput()
|
||||
|
||||
log.Debugf("Using api type : %s", apiType)
|
||||
// XXX:
|
||||
// Check we are in gopath or ask for the gomod name
|
||||
// Create directory
|
||||
|
Reference in New Issue
Block a user