diff options
Diffstat (limited to 'vendor/github.com/99designs/gqlgen/plugin/servergen/server.go')
-rw-r--r-- | vendor/github.com/99designs/gqlgen/plugin/servergen/server.go | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/vendor/github.com/99designs/gqlgen/plugin/servergen/server.go b/vendor/github.com/99designs/gqlgen/plugin/servergen/server.go deleted file mode 100644 index 22289c02..00000000 --- a/vendor/github.com/99designs/gqlgen/plugin/servergen/server.go +++ /dev/null @@ -1,49 +0,0 @@ -package servergen - -import ( - "log" - "os" - - "github.com/99designs/gqlgen/codegen" - "github.com/99designs/gqlgen/codegen/templates" - "github.com/99designs/gqlgen/plugin" - "github.com/pkg/errors" -) - -func New(filename string) plugin.Plugin { - return &Plugin{filename} -} - -type Plugin struct { - filename string -} - -var _ plugin.CodeGenerator = &Plugin{} - -func (m *Plugin) Name() string { - return "servergen" -} -func (m *Plugin) GenerateCode(data *codegen.Data) error { - serverBuild := &ServerBuild{ - ExecPackageName: data.Config.Exec.ImportPath(), - ResolverPackageName: data.Config.Resolver.ImportPath(), - } - - if _, err := os.Stat(m.filename); os.IsNotExist(errors.Cause(err)) { - return templates.Render(templates.Options{ - PackageName: "main", - Filename: m.filename, - Data: serverBuild, - }) - } - - log.Printf("Skipped server: %s already exists\n", m.filename) - return nil -} - -type ServerBuild struct { - codegen.Data - - ExecPackageName string - ResolverPackageName string -} |