-
Notifications
You must be signed in to change notification settings - Fork 8
/
service.go
37 lines (30 loc) · 1.01 KB
/
service.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package mify
import (
"github.com/mify-io/mify/pkg/mifyconfig"
"github.com/mify-io/mify/pkg/workspace"
"github.com/mify-io/mify/pkg/workspace/mutators/service"
)
func CreateService(ctx *CliContext, basePath string, language string, template string, name string) error {
mutCtx := ctx.MustGetMutatorContext()
err := service.CreateService(mutCtx, mifyconfig.ServiceLanguage(language), template, name)
if err != nil {
return err
}
return ServiceGenerate(ctx, basePath, name, false, false)
}
func CreateFrontend(ctx *CliContext, basePath string, template string, name string) error {
mutCtx := ctx.MustGetMutatorContext()
err := service.CreateFrontend(mutCtx, template, name)
if err != nil {
return err
}
return ServiceGenerate(ctx, basePath, name, false, false)
}
func CreateApiGateway(ctx *CliContext) error {
mutCtx := ctx.MustGetMutatorContext()
err := service.CreateApiGateway(mutCtx)
if err != nil {
return err
}
return ServiceGenerate(ctx, ctx.WorkspacePath, workspace.ApiGatewayName, false, false)
}