Skip to content

Commit 4442584

Browse files
authored
fix: adding Apikey (#59)
Co-authored-by: Dimy Jeannot <>
1 parent 82cfafc commit 4442584

File tree

21 files changed

+686
-131
lines changed

21 files changed

+686
-131
lines changed

libs/plugins/protoc-gen-platform/languages/go/plugins/cli_methods/go_cli_methods.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cli_methods
22

33
import (
44
"embed"
5+
"path/filepath"
56
"sort"
67
"strings"
78
"text/template"
@@ -18,7 +19,7 @@ import (
1819
var templates embed.FS
1920

2021
var (
21-
goOutPath = pgs.JoinPaths("platform")
22+
goOutPath = pgs.JoinPaths()
2223
outPath = &goOutPath
2324
)
2425

@@ -125,7 +126,10 @@ func (m GoCliMethodsModule) GenerateFile(file pgs.File) {
125126
version := fns.GetPackageVersion(file)
126127
methodName := method.Name().LowerSnakeCase().String()
127128

128-
name := outPath.SetExt("/" + system + "/" + version + "/" + system + version + "pbcli" + "/" + methodName + ".cmd.go").String()
129+
fullPath := file.InputPath().String()
130+
dirPath := filepath.Dir(fullPath)
131+
132+
name := outPath.SetExt("/" + dirPath + "/" + system + version + "pbcli" + "/" + methodName + ".cmd.go").String()
129133
m.OverwriteGeneratorTemplateFile(name, m.Tpl, method)
130134

131135
// name := m.ctx.OutputPath(file).SetBase(method.Name().LowerSnakeCase().String()).SetExt(".pb." + l.FileExtension())

libs/plugins/protoc-gen-platform/languages/go/plugins/cli_service/go_cli_service.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cli_service
22

33
import (
44
"embed"
5+
"path/filepath"
56
"sort"
67
"strings"
78
"text/template"
@@ -16,7 +17,7 @@ import (
1617
var templates embed.FS
1718

1819
var (
19-
goOutPath = pgs.JoinPaths("platform")
20+
goOutPath = pgs.JoinPaths()
2021
outPath = &goOutPath
2122
)
2223

@@ -118,9 +119,9 @@ func (m GoCliServiceModule) GenerateFile(file pgs.File) {
118119
system := fns.DomainSystemName2(file).LowerCamelCase().String()
119120
version := fns.GetPackageVersion(file)
120121
fileName := fns.ProtoName(file)
121-
name := outPath.SetExt("/" + system + "/" + version + "/" + system + version + "pbcli" + "/" + fileName + ".cmds.go").String()
122-
m.OverwriteGeneratorTemplateFile(name, m.Tpl, file)
122+
fullPath := file.InputPath().String()
123+
dirPath := filepath.Dir(fullPath)
123124

124-
// name := m.ctx.OutputPath(file).SetExt(".cmd." + l.FileExtension())
125-
// m.OverwriteGeneratorTemplateFile(name.String(), m.Tpl, file)
125+
name := outPath.SetExt("/" + dirPath + "/" + system + version + "pbcli" + "/" + fileName + ".cmds.go").String()
126+
m.OverwriteGeneratorTemplateFile(name, m.Tpl, file)
126127
}

libs/plugins/protoc-gen-platform/languages/go/plugins/cli_system/go_cli_system.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cli_system
22

33
import (
44
"embed"
5+
"path/filepath"
56
"sort"
67
"strings"
78
"text/template"
@@ -16,7 +17,7 @@ import (
1617
var (
1718
//go:embed templates/*.tmpl
1819
templates embed.FS
19-
goOutPath = pgs.JoinPaths("platform")
20+
goOutPath = pgs.JoinPaths("")
2021
outPath = &goOutPath
2122
)
2223

@@ -130,7 +131,11 @@ func (m GoCliSystemModule) GenerateFile(file pgs.File) {
130131
system := fns.DomainSystemName2(file).LowerCamelCase().String()
131132
version := fns.GetPackageVersion(file)
132133
fileName := fns.ProtoName(file)
133-
name := outPath.SetExt("/" + system + "/" + version + "/" + system + version + "pbcli" + "/" + fileName + ".cmd.go").String()
134+
135+
fullPath := file.InputPath().String()
136+
dirPath := filepath.Dir(fullPath)
137+
138+
name := outPath.SetExt("/" + dirPath + "/" + system + version + "pbcli" + "/" + fileName + ".cmd.go").String()
134139
m.OverwriteGeneratorTemplateFile(name, m.Tpl, file)
135140

136141
// name := m.ctx.OutputPath(file).SetExt(".cmd." + l.FileExtension())

libs/plugins/protoc-gen-platform/languages/go/plugins/cli_systems/go_cli_systems.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cli_systems
22

33
import (
44
"embed"
5+
"path/filepath"
56
"sort"
67
"strings"
78
"text/template"
@@ -16,7 +17,7 @@ import (
1617
var (
1718
//go:embed templates/*.tmpl
1819
templates embed.FS
19-
goOutPath = pgs.JoinPaths("platform")
20+
goOutPath = pgs.JoinPaths("")
2021
outPath = &goOutPath
2122
)
2223

@@ -129,6 +130,9 @@ func (m GoCliSystemsModule) GenerateFile(file pgs.File) {
129130

130131
system := fns.DomainSystemName2(file).LowerCamelCase().String()
131132
version := fns.GetPackageVersion(file)
132-
name := outPath.SetExt("/" + system + "/" + version + "/" + system + version + "pbcli" + "/" + "systems.cmd.go").String()
133+
fullPath := file.InputPath().String()
134+
dirPath := filepath.Dir(fullPath)
135+
136+
name := outPath.SetExt("/" + dirPath + "/" + system + version + "pbcli" + "/" + "systems.cmd.go").String()
133137
m.OverwriteGeneratorTemplateFile(name, m.Tpl, file)
134138
}

libs/plugins/protoc-gen-platform/languages/go/plugins/entity_unspecified/templates/entity.go.tmpl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ func (entity *{{ $entityName.UpperCamelCase }}SpecEntity) internal() {
115115
// Enum
116116
var _ *{{ enumTypePackage . }}{{ .Type.Enum.Name.UpperCamelCase }}
117117
{{- else if isMap . }}
118-
//{{ .Name }}
118+
//{{ .Name }}
119+
{{- else if .Type.IsRepeated }}
120+
//Repeated {{ .Name }}
121+
var _ {{ sliceValueTypePackage . }}{{ sliceValueType . }}
119122
{{- else if isStructPB . -}}
120123
//{{ .Name }}
121124
{{- else if isStruct . -}}

0 commit comments

Comments
 (0)