Skip to content

Commit

Permalink
package proto
Browse files Browse the repository at this point in the history
  • Loading branch information
Pipello committed Oct 10, 2024
1 parent fed350f commit 308a102
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions definition/model_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,7 @@ type CompleteGenerator struct {
}

func (m *CompleteGenerator) getProtoServiceFilePath() string {
if m.Config.ProtoBufFileName != "" {
return "./api/" + m.Config.ProtoBufFileName
}
return fmt.Sprintf("./api/%s.proto", strcase.ToSnake(m.Config.GRPCServiceName))
return fmt.Sprintf("./api/%s.proto", strcase.ToSnake(m.Config.ServiceName))
}

func (m *CompleteGenerator) readCustomBlocks() {
Expand Down Expand Up @@ -301,9 +298,9 @@ func getFilePath(name string) string {
}

type Config struct {
ProtoBufFileName string
GRPCServiceName string
RepositoryName string
ServiceName string
GRPCServiceName string
RepositoryName string
}

type Generator interface {
Expand Down
2 changes: 1 addition & 1 deletion definition/service.proto.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

syntax = "proto3";

package main;
package {{.Config.ServiceName}};

option go_package = "{{.Config.RepositoryName}}/api";

Expand Down

0 comments on commit 308a102

Please sign in to comment.