fix(lint): Start to apply linter recommandation
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:
@ -9,7 +9,7 @@ import (
|
||||
"git.home.m-and-m.ovh/mderasse/gouick/helpers/models"
|
||||
)
|
||||
|
||||
func GetApiType(in models.ApiTypeName) (ApiTypeInterface, error) {
|
||||
func GetAPIType(in models.APITypeName) (APITypeInterface, error) {
|
||||
if in == "" {
|
||||
return nil, errors.BadRequestf("missing parameter")
|
||||
}
|
||||
@ -19,12 +19,12 @@ func GetApiType(in models.ApiTypeName) (ApiTypeInterface, error) {
|
||||
}
|
||||
|
||||
switch in {
|
||||
case models.ApiTypeName_GIN_GONIC:
|
||||
return gin_gonic.ApiType{}, nil
|
||||
case models.ApiTypeName_GO_SWAGGER:
|
||||
return go_swagger.ApiType{}, nil
|
||||
case models.ApiTypeName_MOJOLICIOUS:
|
||||
return mojolicious.ApiType{}, nil
|
||||
case models.APITypeName_GIN_GONIC:
|
||||
return gin_gonic.APIType{}, nil
|
||||
case models.APITypeName_GO_SWAGGER:
|
||||
return go_swagger.APIType{}, nil
|
||||
case models.APITypeName_MOJOLICIOUS:
|
||||
return mojolicious.APIType{}, nil
|
||||
}
|
||||
|
||||
return nil, errors.NotFoundf("Unknown Api Type")
|
||||
|
@ -1,5 +1,5 @@
|
||||
package base
|
||||
|
||||
// ApiType
|
||||
type ApiType struct {
|
||||
// APIType
|
||||
type APIType struct {
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
)
|
||||
|
||||
// CheckInitialize
|
||||
func (a ApiType) CheckInitialize() error {
|
||||
func (a APIType) CheckInitialize() error {
|
||||
|
||||
return errors.NotImplementedf("CheckInitialize not implemented for %s", a.GetName())
|
||||
}
|
||||
|
@ -4,6 +4,6 @@ import (
|
||||
"git.home.m-and-m.ovh/mderasse/gouick/helpers/models"
|
||||
)
|
||||
|
||||
func (a ApiType) GetName() models.ApiTypeName {
|
||||
return models.ApiTypeName_NULL
|
||||
func (a APIType) GetName() models.APITypeName {
|
||||
return models.APITypeName_NULL
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"github.com/juju/errors"
|
||||
)
|
||||
|
||||
func (a ApiType) GetInitializeUserInput(params *models.UserInputParams) (*models.UserInputParams, error) {
|
||||
func (a APIType) GetInitializeUserInput(params *models.UserInputParams) (*models.UserInputParams, error) {
|
||||
|
||||
return nil, errors.NotImplementedf("GetInitializeUserInput not implemented for %s", a.GetName())
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package gin_gonic
|
||||
|
||||
import "git.home.m-and-m.ovh/mderasse/gouick/helpers/api_types/base"
|
||||
|
||||
// ApiType
|
||||
type ApiType struct {
|
||||
base.ApiType
|
||||
// APIType
|
||||
type APIType struct {
|
||||
base.APIType
|
||||
}
|
||||
|
@ -4,6 +4,6 @@ import (
|
||||
"git.home.m-and-m.ovh/mderasse/gouick/helpers/models"
|
||||
)
|
||||
|
||||
func (a ApiType) GetName() models.ApiTypeName {
|
||||
return models.ApiTypeName_GIN_GONIC
|
||||
func (a APIType) GetName() models.APITypeName {
|
||||
return models.APITypeName_GIN_GONIC
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package go_swagger
|
||||
|
||||
import "git.home.m-and-m.ovh/mderasse/gouick/helpers/api_types/base"
|
||||
|
||||
// ApiType
|
||||
type ApiType struct {
|
||||
base.ApiType
|
||||
// APIType
|
||||
type APIType struct {
|
||||
base.APIType
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
// CheckInitialize
|
||||
func (a ApiType) CheckInitialize() error {
|
||||
func (a APIType) CheckInitialize() error {
|
||||
|
||||
log.Debugf("Starting %s check initialize", string(a.GetName()))
|
||||
|
||||
|
@ -4,6 +4,6 @@ import (
|
||||
"git.home.m-and-m.ovh/mderasse/gouick/helpers/models"
|
||||
)
|
||||
|
||||
func (a ApiType) GetName() models.ApiTypeName {
|
||||
return models.ApiTypeName_GO_SWAGGER
|
||||
func (a APIType) GetName() models.APITypeName {
|
||||
return models.APITypeName_GO_SWAGGER
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
// GetInitializeUserInput
|
||||
func (a ApiType) GetInitializeUserInput(params *models.UserInputParams) (*models.UserInputParams, error) {
|
||||
func (a APIType) GetInitializeUserInput(params *models.UserInputParams) (*models.UserInputParams, error) {
|
||||
|
||||
log.Debugf("Starting %s user input", a.GetName())
|
||||
|
||||
|
@ -2,9 +2,9 @@ package api_types
|
||||
|
||||
import "git.home.m-and-m.ovh/mderasse/gouick/helpers/models"
|
||||
|
||||
// ApiTypeInterface
|
||||
type ApiTypeInterface interface {
|
||||
// APITypeInterface
|
||||
type APITypeInterface interface {
|
||||
CheckInitialize() error
|
||||
GetName() models.ApiTypeName
|
||||
GetName() models.APITypeName
|
||||
GetInitializeUserInput(params *models.UserInputParams) (*models.UserInputParams, error)
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package mojolicious
|
||||
|
||||
import "git.home.m-and-m.ovh/mderasse/gouick/helpers/api_types/base"
|
||||
|
||||
// ApiType
|
||||
type ApiType struct {
|
||||
base.ApiType
|
||||
// APIType
|
||||
type APIType struct {
|
||||
base.APIType
|
||||
}
|
||||
|
@ -4,6 +4,6 @@ import (
|
||||
"git.home.m-and-m.ovh/mderasse/gouick/helpers/models"
|
||||
)
|
||||
|
||||
func (a ApiType) GetName() models.ApiTypeName {
|
||||
return models.ApiTypeName_MOJOLICIOUS
|
||||
func (a APIType) GetName() models.APITypeName {
|
||||
return models.APITypeName_MOJOLICIOUS
|
||||
}
|
||||
|
Reference in New Issue
Block a user