-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add all remaining features and bug fixes
- Loading branch information
1 parent
42e7dc8
commit 0327e75
Showing
49 changed files
with
2,831 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,3 @@ vendor/ | |
|
||
.DS_Store | ||
*.iml | ||
test_dir/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// addCmd represents the add command | ||
var addCmd = &cobra.Command{ | ||
Use: "add", | ||
Short: "Use to add additional transports to a service", | ||
} | ||
|
||
func init() { | ||
RootCmd.AddCommand(addCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/Sirupsen/logrus" | ||
"github.com/kujtimiihoxha/gk/generator" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// grpcCmd represents the grpc command | ||
var grpcCmd = &cobra.Command{ | ||
Use: "grpc", | ||
Short: "Initiates grpc transport after creating the protobuf", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
if len(args) == 0 { | ||
logrus.Error("You must provide the service name") | ||
return | ||
} | ||
g := generator.NewGRPCInitGenerator() | ||
err := g.Generate(args[0]) | ||
if err != nil { | ||
logrus.Error(err) | ||
return | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
initCmd.AddCommand(grpcCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/Sirupsen/logrus" | ||
"github.com/kujtimiihoxha/gk/generator" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// grpc_addCmd represents the grpc_add command | ||
var grpc_addCmd = &cobra.Command{ | ||
Use: "grpc", | ||
Short: "Add grpc transport to service", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
if len(args) == 0 { | ||
logrus.Error("You must provide the service name") | ||
return | ||
} | ||
g := generator.NewAddGRPCGenerator() | ||
err := g.Generate(args[0]) | ||
if err != nil { | ||
logrus.Error(err) | ||
return | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
addCmd.AddCommand(grpc_addCmd) | ||
|
||
// Here you will define your flags and configuration settings. | ||
|
||
// Cobra supports Persistent Flags which will work for this command | ||
// and all subcommands, e.g.: | ||
// grpc_addCmd.PersistentFlags().String("foo", "", "A help for foo") | ||
|
||
// Cobra supports local flags which will only run when this command | ||
// is called directly, e.g.: | ||
// grpc_addCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/Sirupsen/logrus" | ||
"github.com/kujtimiihoxha/gk/generator" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// http_addCmd represents the http_add command | ||
var http_addCmd = &cobra.Command{ | ||
Use: "http", | ||
Short: "Add http transport to service", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
if len(args) == 0 { | ||
logrus.Error("You must provide the service name") | ||
return | ||
} | ||
g := generator.NewAddHttpGenerator() | ||
err := g.Generate(args[0]) | ||
if err != nil { | ||
logrus.Error(err) | ||
return | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
addCmd.AddCommand(http_addCmd) | ||
|
||
// Here you will define your flags and configuration settings. | ||
|
||
// Cobra supports Persistent Flags which will work for this command | ||
// and all subcommands, e.g.: | ||
// http_addCmd.PersistentFlags().String("foo", "", "A help for foo") | ||
|
||
// Cobra supports local flags which will only run when this command | ||
// is called directly, e.g.: | ||
// http_addCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/Sirupsen/logrus" | ||
"github.com/kujtimiihoxha/gk/generator" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var thriftCmd = &cobra.Command{ | ||
Use: "thrift", | ||
Short: "Initiates thrift transport after creating the thrift service", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
if len(args) == 0 { | ||
logrus.Error("You must provide the service name") | ||
return | ||
} | ||
g := generator.NewThriftInitGenerator() | ||
err := g.Generate(args[0]) | ||
if err != nil { | ||
logrus.Error(err) | ||
return | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
initCmd.AddCommand(thriftCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/Sirupsen/logrus" | ||
"github.com/kujtimiihoxha/gk/generator" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var thrift_addCmd = &cobra.Command{ | ||
Use: "thrift", | ||
Short: "Add thrift transport to service", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
if len(args) == 0 { | ||
logrus.Error("You must provide the service name") | ||
return | ||
} | ||
g := generator.NewAddThriftGenerator() | ||
err := g.Generate(args[0]) | ||
if err != nil { | ||
logrus.Error(err) | ||
return | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
addCmd.AddCommand(thrift_addCmd) | ||
|
||
// Here you will define your flags and configuration settings. | ||
|
||
// Cobra supports Persistent Flags which will work for this command | ||
// and all subcommands, e.g.: | ||
// thrift_addCmd.PersistentFlags().String("foo", "", "A help for foo") | ||
|
||
// Cobra supports local flags which will only run when this command | ||
// is called directly, e.g.: | ||
// thrift_addCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") | ||
|
||
} |
Oops, something went wrong.