diff --git a/cmd/client.go b/cmd/client.go index 4de6068..3cbb750 100644 --- a/cmd/client.go +++ b/cmd/client.go @@ -1,8 +1,8 @@ package cmd import ( - "github.com/Sirupsen/logrus" "github.com/kujtimiihoxha/kit/generator" + "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/cmd/docker.go b/cmd/docker.go index 59fd85b..4784b2b 100644 --- a/cmd/docker.go +++ b/cmd/docker.go @@ -1,8 +1,8 @@ package cmd import ( - "github.com/Sirupsen/logrus" "github.com/kujtimiihoxha/kit/generator" + "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/cmd/g_service.go b/cmd/g_service.go index 16bb2c6..c5db132 100644 --- a/cmd/g_service.go +++ b/cmd/g_service.go @@ -1,8 +1,8 @@ package cmd import ( - "github.com/Sirupsen/logrus" "github.com/kujtimiihoxha/kit/generator" + "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/viper" ) @@ -47,7 +47,7 @@ var initserviceCmd = &cobra.Command{ func init() { generateCmd.AddCommand(initserviceCmd) initserviceCmd.Flags().StringP("transport", "t", "http", "The transport you want your service to be initiated with") - initserviceCmd.Flags().BoolP("dmw","w", false, "Generate default middleware for service and endpoint") + initserviceCmd.Flags().BoolP("dmw", "w", false, "Generate default middleware for service and endpoint") initserviceCmd.Flags().Bool("gorilla", false, "Generate http using gorilla mux") initserviceCmd.Flags().StringArrayVarP(&methods, "methods", "m", []string{}, "Specify methods to be generated") initserviceCmd.Flags().Bool("svc-mdw", false, "If set a default Logging and Instrumental middleware will be created and attached to the service") diff --git a/cmd/middleware.go b/cmd/middleware.go index d6a8da6..cbce7d5 100644 --- a/cmd/middleware.go +++ b/cmd/middleware.go @@ -1,8 +1,8 @@ package cmd import ( - "github.com/Sirupsen/logrus" "github.com/kujtimiihoxha/kit/generator" + "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/cmd/root.go b/cmd/root.go index d1e29e3..70d2306 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -5,7 +5,7 @@ import ( "os/exec" "runtime" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/cmd/service.go b/cmd/service.go index 1172a0f..47baf00 100644 --- a/cmd/service.go +++ b/cmd/service.go @@ -1,8 +1,8 @@ package cmd import ( - "github.com/Sirupsen/logrus" "github.com/kujtimiihoxha/kit/generator" + "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) diff --git a/fs/fs.go b/fs/fs.go index ca02e39..8ea34ec 100644 --- a/fs/fs.go +++ b/fs/fs.go @@ -4,8 +4,8 @@ import ( "fmt" "os" - "github.com/Sirupsen/logrus" "github.com/Songmu/prompter" + "github.com/sirupsen/logrus" "github.com/spf13/afero" "github.com/spf13/viper" ) diff --git a/generator/add_transport.go b/generator/add_transport.go index 1309419..dbc6903 100644 --- a/generator/add_transport.go +++ b/generator/add_transport.go @@ -15,14 +15,14 @@ import ( "errors" - "github.com/Sirupsen/logrus" "github.com/dave/jennifer/jen" "github.com/emicklei/proto" + "github.com/emicklei/proto-contrib/pkg/protofmt" "github.com/kujtimiihoxha/kit/fs" "github.com/kujtimiihoxha/kit/parser" "github.com/kujtimiihoxha/kit/utils" + "github.com/sirupsen/logrus" "github.com/spf13/viper" - "github.com/emicklei/proto-contrib/pkg/protofmt" ) // GenerateTransport implement Gen, is used to generate a service transport diff --git a/generator/add_transport_test.go b/generator/add_transport_test.go index 3974295..f9405b9 100644 --- a/generator/add_transport_test.go +++ b/generator/add_transport_test.go @@ -719,7 +719,7 @@ func Test_newGenerateHTTPTransport(t *testing.T) { args args want Gen }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -747,7 +747,7 @@ func Test_generateHTTPTransport_Generate(t *testing.T) { fields fields wantErr bool }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -782,7 +782,7 @@ func Test_newGenerateHTTPTransportBase(t *testing.T) { args args want Gen }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -811,7 +811,7 @@ func Test_generateHTTPTransportBase_Generate(t *testing.T) { fields fields wantErr bool }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -845,7 +845,7 @@ func Test_newGenerateGRPCTransportProto(t *testing.T) { args args want Gen }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -874,7 +874,7 @@ func Test_generateGRPCTransportProto_Generate(t *testing.T) { fields fields wantErr bool }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -915,7 +915,7 @@ func Test_generateGRPCTransportProto_getService(t *testing.T) { fields fields want *proto.Service }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -955,7 +955,7 @@ func Test_generateGRPCTransportProto_generateRequestResponse(t *testing.T) { name string fields fields }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -997,7 +997,7 @@ func Test_generateGRPCTransportProto_getServiceRPC(t *testing.T) { fields fields args args }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -1030,7 +1030,7 @@ func Test_newGenerateGRPCTransportBase(t *testing.T) { args args want Gen }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -1059,7 +1059,7 @@ func Test_generateGRPCTransportBase_Generate(t *testing.T) { fields fields wantErr bool }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -1093,7 +1093,7 @@ func Test_newGenerateGRPCTransport(t *testing.T) { args args want Gen }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -1121,7 +1121,7 @@ func Test_generateGRPCTransport_Generate(t *testing.T) { fields fields wantErr bool }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/generator/generate_client.go b/generator/generate_client.go index feafdd5..83ee835 100644 --- a/generator/generate_client.go +++ b/generator/generate_client.go @@ -6,11 +6,11 @@ import ( "strings" - "github.com/Sirupsen/logrus" "github.com/dave/jennifer/jen" "github.com/kujtimiihoxha/kit/fs" "github.com/kujtimiihoxha/kit/parser" "github.com/kujtimiihoxha/kit/utils" + "github.com/sirupsen/logrus" "github.com/spf13/viper" ) diff --git a/generator/generate_middleware.go b/generator/generate_middleware.go index a70e920..0d1bf66 100644 --- a/generator/generate_middleware.go +++ b/generator/generate_middleware.go @@ -6,11 +6,11 @@ import ( "strings" - "github.com/Sirupsen/logrus" "github.com/dave/jennifer/jen" "github.com/kujtimiihoxha/kit/fs" "github.com/kujtimiihoxha/kit/parser" "github.com/kujtimiihoxha/kit/utils" + "github.com/sirupsen/logrus" "github.com/spf13/viper" ) diff --git a/generator/generate_service.go b/generator/generate_service.go index 39a268b..e1e2276 100644 --- a/generator/generate_service.go +++ b/generator/generate_service.go @@ -5,11 +5,11 @@ import ( "path" "strings" - "github.com/Sirupsen/logrus" "github.com/dave/jennifer/jen" "github.com/kujtimiihoxha/kit/fs" "github.com/kujtimiihoxha/kit/parser" "github.com/kujtimiihoxha/kit/utils" + "github.com/sirupsen/logrus" "github.com/spf13/viper" ) diff --git a/generator/generator.go b/generator/generator.go index bdfb6ec..2fc96d5 100644 --- a/generator/generator.go +++ b/generator/generator.go @@ -13,11 +13,11 @@ import ( "bytes" "go/format" - "github.com/Sirupsen/logrus" "github.com/dave/jennifer/jen" "github.com/kujtimiihoxha/kit/fs" "github.com/kujtimiihoxha/kit/parser" "github.com/kujtimiihoxha/kit/utils" + "github.com/sirupsen/logrus" ) // Gen represents a generator. diff --git a/glide.yaml b/glide.yaml deleted file mode 100644 index 7bb01a3..0000000 --- a/glide.yaml +++ /dev/null @@ -1,25 +0,0 @@ -package: github.com/kujtimiihoxha/kit -import: -- package: github.com/spf13/cobra - subpackages: - - cobra -- package: github.com/Sirupsen/logrus - repo: https://github.com/sirupsen/logrus.git -- package: github.com/sirupsen/logrus - version: ^1.0.3 -- package: github.com/spf13/afero -- package: github.com/Songmu/prompter - version: ^0.1.0 -- package: github.com/spf13/viper - version: ^1.0.0 -- package: github.com/alioygur/godash -- package: github.com/smartystreets/goconvey - version: ^1.6.3 -- package: github.com/dave/jennifer - version: ^0.14.0 -- package: golang.org/x/tools - subpackages: - - imports -- package: github.com/emicklei/proto -- package: github.com/go-yaml/yaml -- package: github.com/emicklei/proto-contrib diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..de82df1 --- /dev/null +++ b/go.mod @@ -0,0 +1,18 @@ +module github.com/kujtimiihoxha/kit + +go 1.12 + +require ( + github.com/Songmu/prompter v0.0.0-20181014095714-d227c68538bd + github.com/alioygur/godash v0.0.0-20160919141744-af6b3da41c5a + github.com/dave/jennifer v1.3.0 + github.com/emicklei/proto v1.6.10 + github.com/emicklei/proto-contrib v0.0.0-20190206213850-73879796f936 + github.com/mattn/go-isatty v0.0.7 // indirect + github.com/sirupsen/logrus v1.4.0 + github.com/spf13/afero v1.2.2 + github.com/spf13/cobra v0.0.3 + github.com/spf13/viper v1.3.2 + golang.org/x/tools v0.0.0-20190401163957-4fc9f0bfa59a + gopkg.in/yaml.v2 v2.2.2 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..8fd48ff --- /dev/null +++ b/go.sum @@ -0,0 +1,67 @@ +github.com/Songmu/prompter v0.0.0-20181014095714-d227c68538bd h1:WPP3dYxBYZBo0q3t14UIvD0Myr848agWCVSlScH17E0= +github.com/Songmu/prompter v0.0.0-20181014095714-d227c68538bd/go.mod h1:fNhSFBGC+sg+dZ7AqDHgq+xYiom23TeTESzUbO7PIrE= +github.com/alioygur/godash v0.0.0-20160919141744-af6b3da41c5a h1:ejThr5VDBanPpuY7E68PuUK48xF+GKJ9b2RmNEmS0co= +github.com/alioygur/godash v0.0.0-20160919141744-af6b3da41c5a/go.mod h1:zi8h8bo9k9pONnS1MD9T7Ajmo7KLaK7u+1/63nUvB0I= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/dave/jennifer v1.3.0 h1:p3tl41zjjCZTNBytMwrUuiAnherNUZktlhPTKoF/sEk= +github.com/dave/jennifer v1.3.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/emicklei/proto v1.6.8/go.mod h1:Dqn751twH9SasYqvA59Lb9Hz+itoJgmMoivX6k7OPZc= +github.com/emicklei/proto v1.6.10 h1:tXKViikmzSAh7X+SCUliSDphrK9JKKkJaAZB84XVCyY= +github.com/emicklei/proto v1.6.10/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A= +github.com/emicklei/proto-contrib v0.0.0-20190206213850-73879796f936 h1:sXk80AaZ0sMwlkZ7rnJcTi2WgXzTZhZz3iS6tr1Sbro= +github.com/emicklei/proto-contrib v0.0.0-20190206213850-73879796f936/go.mod h1:WhnsyUacG9u39ADSgKY555WFJ4cVjZmEzN6vpvjfoQs= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/sirupsen/logrus v1.4.0 h1:yKenngtzGh+cUSSh6GWbxW2abRqhYUSR/t/6+2QqNvE= +github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/viper v1.3.2 h1:VUFqw5KcqRf7i70GOzW7N+Q7+gxVBkSSqiXB12+JQ4M= +github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190401163957-4fc9f0bfa59a h1:8uDq1cly8U9Rv4OKK7v3+67Eci6dUaa/tGZbJ/2KzpM= +golang.org/x/tools v0.0.0-20190401163957-4fc9f0bfa59a/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/main.go b/main.go index 04f5bc0..fe22d73 100644 --- a/main.go +++ b/main.go @@ -6,9 +6,9 @@ import ( "runtime" "strings" - "github.com/Sirupsen/logrus" "github.com/kujtimiihoxha/kit/cmd" "github.com/kujtimiihoxha/kit/utils" + "github.com/sirupsen/logrus" "github.com/spf13/afero" "github.com/spf13/viper" ) diff --git a/parser/parse.go b/parser/parse.go index d5631b7..656dbd0 100644 --- a/parser/parse.go +++ b/parser/parse.go @@ -9,8 +9,8 @@ import ( "go/token" "strings" - "github.com/Sirupsen/logrus" "github.com/kujtimiihoxha/kit/utils" + "github.com/sirupsen/logrus" ) // FileParser is the parser used by kit to parse go files.