Skip to content

Commit

Permalink
updated to internal records and go version
Browse files Browse the repository at this point in the history
  • Loading branch information
oli4maes committed Dec 29, 2024
1 parent dc69c02 commit 8531b2e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
module github.com/oli4maes/mediator-tools

go 1.21.3
go 1.23.4

require github.com/spf13/cobra v1.8.1

require (
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spf13/cobra v1.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ func main() {
cmd.Execute()

// Uncomment to test file generation
// GOLANG
// Go
//filegeneration.GenerateFiles("test", filegeneration.HandlerFileType, filegeneration.Golang)
//filegeneration.GenerateFiles("test", filegeneration.RequestFileType, filegeneration.Golang)
//filegeneration.GenerateFiles("test", filegeneration.ResponseFileType, filegeneration.Golang)
Expand Down
2 changes: 0 additions & 2 deletions templates/cs/handler.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ namespace

internal sealed class {{ .FeatureName }}Handler : IRequestHandler<{{ .FeatureName }}Request, {{ .FeatureName }}Response>
{
public {{ .FeatureName }}Handler(){}

public async Task<{{ .FeatureName }}Response> Handle({{ .FeatureName }}Request request, CancellationToken cancellationToken)
{
return new {{ .FeatureName }}Response(){};
Expand Down
2 changes: 1 addition & 1 deletion templates/cs/request.tmpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
namespace

public sealed record {{ .FeatureName }}Request() : IRequest<{{ .FeatureName }}Response>;
internal sealed record {{ .FeatureName }}Request() : IRequest<{{ .FeatureName }}Response>;
4 changes: 1 addition & 3 deletions templates/cs/response.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
namespace

public sealed class {{ .FeatureName }}Response
{
}
internal sealed record {{ .FeatureName }}Response

0 comments on commit 8531b2e

Please sign in to comment.