aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/99designs/gqlgen/codegen/import.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/99designs/gqlgen/codegen/import.go')
-rw-r--r--vendor/github.com/99designs/gqlgen/codegen/import.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/vendor/github.com/99designs/gqlgen/codegen/import.go b/vendor/github.com/99designs/gqlgen/codegen/import.go
new file mode 100644
index 00000000..b511e8f6
--- /dev/null
+++ b/vendor/github.com/99designs/gqlgen/codegen/import.go
@@ -0,0 +1,29 @@
+package codegen
+
+import (
+ "strconv"
+)
+
+type Import struct {
+ Name string
+ Path string
+
+ alias string
+}
+
+type Imports struct {
+ imports []*Import
+ destDir string
+}
+
+func (i *Import) Write() string {
+ return i.Alias() + " " + strconv.Quote(i.Path)
+}
+
+func (i *Import) Alias() string {
+ if i.alias == "" {
+ panic("alias called before imports are finalized")
+ }
+
+ return i.alias
+}