diff --git a/cmd/g_service.go b/cmd/g_service.go index c5db132..d2b9457 100644 --- a/cmd/g_service.go +++ b/cmd/g_service.go @@ -2,6 +2,7 @@ package cmd import ( "github.com/kujtimiihoxha/kit/generator" + "github.com/kujtimiihoxha/kit/utils" "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -22,6 +23,21 @@ var initserviceCmd = &cobra.Command{ return } } + var pbPath, pbImportPath string + pbPath = viper.GetString("g_s_pb_path") + pbImportPath = viper.GetString("g_s_pb_import_path") + if pbPath != "" { + exist := utils.IsExist(pbPath) + if !exist { + logrus.Errorf("You must provide a existed pb path to store pb dir, given path:<%s> is not exist", pbPath) + return + } + if pbImportPath == "" { + logrus.Error("You must provide pb import path by --pb_import_path or -i, because you provide a pb_path") + return + } + } + var emw, smw bool if viper.GetBool("g_s_dmw") { emw = true @@ -33,6 +49,8 @@ var initserviceCmd = &cobra.Command{ g := generator.NewGenerateService( args[0], viper.GetString("g_s_transport"), + pbPath, + pbImportPath, smw, viper.GetBool("g_s_gorilla"), emw, @@ -47,12 +65,16 @@ 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().StringP("pb_path", "p", "", "Specify path to store pb dir") + initserviceCmd.Flags().StringP("pb_import_path", "i", "", "Specify path to import pb") 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") initserviceCmd.Flags().Bool("endpoint-mdw", false, "If set a default Logging and Tracking middleware will be created and attached to the endpoint") viper.BindPFlag("g_s_transport", initserviceCmd.Flags().Lookup("transport")) + viper.BindPFlag("g_s_pb_path", initserviceCmd.Flags().Lookup("pb_path")) + viper.BindPFlag("g_s_pb_import_path", initserviceCmd.Flags().Lookup("pb_import_path")) viper.BindPFlag("g_s_dmw", initserviceCmd.Flags().Lookup("dmw")) viper.BindPFlag("g_s_gorilla", initserviceCmd.Flags().Lookup("gorilla")) viper.BindPFlag("g_s_svc_mdw", initserviceCmd.Flags().Lookup("svc-mdw")) diff --git a/generator/add_transport.go b/generator/add_transport.go index 42b58c7..ec51931 100644 --- a/generator/add_transport.go +++ b/generator/add_transport.go @@ -33,6 +33,8 @@ type GenerateTransport struct { gorillaMux bool interfaceName string destPath string + pbPath string + pbImportPath string methods []string filePath string file *parser.File @@ -40,7 +42,7 @@ type GenerateTransport struct { } // NewGenerateTransport returns a transport generator. -func NewGenerateTransport(name string, gorillaMux bool, transport string, methods []string) Gen { +func NewGenerateTransport(name string, gorillaMux bool, transport, pbPath, pbImportPath string, methods []string) Gen { i := &GenerateTransport{ name: name, gorillaMux: gorillaMux, @@ -50,6 +52,10 @@ func NewGenerateTransport(name string, gorillaMux bool, transport string, method } i.filePath = path.Join(i.destPath, viper.GetString("gk_service_file_name")) i.transport = transport + // Customize pb path + i.pbPath = pbPath + i.pbImportPath = pbImportPath + // Not used. i.srcFile = jen.NewFilePath("") i.InitPg() @@ -99,17 +105,17 @@ func (g *GenerateTransport) Generate() (err error) { return err } case "grpc": - gp := newGenerateGRPCTransportProto(g.name, g.serviceInterface, g.methods) + gp := newGenerateGRPCTransportProto(g.name, g.pbPath, g.serviceInterface, g.methods) err = gp.Generate() if err != nil { return err } - gt := newGenerateGRPCTransport(g.name, g.serviceInterface, g.methods) + gt := newGenerateGRPCTransport(g.name, g.pbImportPath, g.serviceInterface, g.methods) err = gt.Generate() if err != nil { return err } - gb := newGenerateGRPCTransportBase(g.name, g.serviceInterface, g.methods, mth) + gb := newGenerateGRPCTransportBase(g.name, g.pbImportPath, g.serviceInterface, g.methods, mth) err = gb.Generate() if err != nil { return err @@ -212,7 +218,8 @@ func (g *generateHTTPTransport) Generate() (err error) { if err != nil { return err } - endpImports, err := utils.GetEndpointImportPath(g.name) + endpointImport, err := utils.GetEndpointImportPath(g.name) + defer func() { recover() }() if err != nil { return err } @@ -320,7 +327,7 @@ func (g *generateHTTPTransport) Generate() (err error) { nil, []jen.Code{ param, - jen.Id("endpoints").Qual(endpImports, "Endpoints"), + jen.Id("endpoints").Qual(endpointImport, "Endpoints"), jen.Id("options").Index().Qual( "github.com/go-kit/kit/transport/http", "ServerOption", @@ -352,7 +359,7 @@ func (g *generateHTTPTransport) Generate() (err error) { jen.Error(), }, "", - jen.Id("req").Op(":=").Qual(endpImports, m.Name+"Request").Block(), + jen.Id("req").Op(":=").Qual(endpointImport, m.Name+"Request").Block(), jen.Err().Op(":=").Qual("encoding/json", "NewDecoder").Call( jen.Id("r").Dot("Body"), ).Dot("Decode").Call(jen.Id("&req")), @@ -373,7 +380,7 @@ func (g *generateHTTPTransport) Generate() (err error) { jen.If( jen.List(jen.Id("f"), jen.Id("ok")).Op(":=").Id("response.").Call( jen.Qual( - endpImports, + endpointImport, "Failure", ), ).Id(";").Id("ok").Id("&&").Id("f").Dot("Failed").Call().Op("!=").Nil(), @@ -643,7 +650,7 @@ type generateGRPCTransportProto struct { serviceInterface parser.Interface } -func newGenerateGRPCTransportProto(name string, serviceInterface parser.Interface, methods []string) Gen { +func newGenerateGRPCTransportProto(name, pbPath string, serviceInterface parser.Interface, methods []string) Gen { t := &generateGRPCTransportProto{ name: name, methods: methods, @@ -651,6 +658,9 @@ func newGenerateGRPCTransportProto(name string, serviceInterface parser.Interfac destPath: fmt.Sprintf(viper.GetString("gk_grpc_pb_path_format"), utils.ToLowerSnakeCase(name)), serviceInterface: serviceInterface, } + if pbPath != "" { + t.destPath = path.Join(pbPath, "pb") + } t.pbFilePath = path.Join( t.destPath, fmt.Sprintf(viper.GetString("gk_grpc_pb_file_name"), utils.ToLowerSnakeCase(name)), @@ -858,6 +868,7 @@ type generateGRPCTransportBase struct { methods []string allMethods []parser.Method interfaceName string + pbImportPath string destPath string filePath string file *parser.File @@ -865,7 +876,7 @@ type generateGRPCTransportBase struct { serviceInterface parser.Interface } -func newGenerateGRPCTransportBase(name string, serviceInterface parser.Interface, methods []string, allMethods []parser.Method) Gen { +func newGenerateGRPCTransportBase(name, pbImportPath string, serviceInterface parser.Interface, methods []string, allMethods []parser.Method) Gen { t := &generateGRPCTransportBase{ name: name, methods: methods, @@ -877,6 +888,7 @@ func newGenerateGRPCTransportBase(name string, serviceInterface parser.Interface t.filePath = path.Join(t.destPath, viper.GetString("gk_grpc_base_file_name")) t.grpcFilePath = path.Join(t.destPath, viper.GetString("gk_grpc_file_name")) t.srcFile = jen.NewFilePath(t.destPath) + t.pbImportPath = pbImportPath t.InitPg() t.fs = fs.Get() return t @@ -891,7 +903,7 @@ func (g *generateGRPCTransportBase) Generate() (err error) { if err != nil { return err } - pbImport, err := utils.GetPbImportPath(g.name) + pbImport, err := utils.GetPbImportPath(g.name, g.pbImportPath) if err != nil { return err } @@ -963,13 +975,14 @@ type generateGRPCTransport struct { methods []string interfaceName string destPath string + pbImportPath string generateFirstTime bool file *parser.File filePath string serviceInterface parser.Interface } -func newGenerateGRPCTransport(name string, serviceInterface parser.Interface, methods []string) Gen { +func newGenerateGRPCTransport(name, pbImportPath string, serviceInterface parser.Interface, methods []string) Gen { t := &generateGRPCTransport{ name: name, methods: methods, @@ -979,6 +992,7 @@ func newGenerateGRPCTransport(name string, serviceInterface parser.Interface, me } t.filePath = path.Join(t.destPath, viper.GetString("gk_grpc_file_name")) t.srcFile = jen.NewFilePath(t.destPath) + t.pbImportPath = pbImportPath t.InitPg() t.fs = fs.Get() return t @@ -992,7 +1006,7 @@ func (g *generateGRPCTransport) Generate() (err error) { if err != nil { return err } - pbImport, err := utils.GetPbImportPath(g.name) + pbImport, err := utils.GetPbImportPath(g.name, g.pbImportPath) if err != nil { return err } diff --git a/generator/add_transport_test.go b/generator/add_transport_test.go index f9405b9..d93c660 100644 --- a/generator/add_transport_test.go +++ b/generator/add_transport_test.go @@ -74,7 +74,7 @@ func TestNewGenerateTransport(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := NewGenerateTransport(tt.args.name, tt.args.gorillaMux, tt.args.transport, tt.args.methods); !reflect.DeepEqual(got, tt.want) { + if got := NewGenerateTransport(tt.args.name, tt.args.gorillaMux, tt.args.transport, "", "", tt.args.methods); !reflect.DeepEqual(got, tt.want) { t.Errorf("NewGenerateTransport() = %v, want %v", got, tt.want) } }) @@ -837,6 +837,7 @@ func Test_generateHTTPTransportBase_Generate(t *testing.T) { func Test_newGenerateGRPCTransportProto(t *testing.T) { type args struct { name string + pbPath string serviceInterface parser.Interface methods []string } @@ -849,7 +850,7 @@ func Test_newGenerateGRPCTransportProto(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newGenerateGRPCTransportProto(tt.args.name, tt.args.serviceInterface, tt.args.methods); !reflect.DeepEqual(got, tt.want) { + if got := newGenerateGRPCTransportProto(tt.args.name, tt.args.pbPath, tt.args.serviceInterface, tt.args.methods); !reflect.DeepEqual(got, tt.want) { t.Errorf("newGenerateGRPCTransportProto() = %v, want %v", got, tt.want) } }) @@ -1021,6 +1022,7 @@ func Test_generateGRPCTransportProto_getServiceRPC(t *testing.T) { func Test_newGenerateGRPCTransportBase(t *testing.T) { type args struct { name string + pbImportPath string serviceInterface parser.Interface methods []string allMethods []parser.Method @@ -1034,7 +1036,7 @@ func Test_newGenerateGRPCTransportBase(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newGenerateGRPCTransportBase(tt.args.name, tt.args.serviceInterface, tt.args.methods, tt.args.allMethods); !reflect.DeepEqual(got, tt.want) { + if got := newGenerateGRPCTransportBase(tt.args.name, tt.args.pbImportPath, tt.args.serviceInterface, tt.args.methods, tt.args.allMethods); !reflect.DeepEqual(got, tt.want) { t.Errorf("newGenerateGRPCTransportBase() = %v, want %v", got, tt.want) } }) @@ -1085,6 +1087,7 @@ func Test_generateGRPCTransportBase_Generate(t *testing.T) { func Test_newGenerateGRPCTransport(t *testing.T) { type args struct { name string + pbImportPath string serviceInterface parser.Interface methods []string } @@ -1097,7 +1100,7 @@ func Test_newGenerateGRPCTransport(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newGenerateGRPCTransport(tt.args.name, tt.args.serviceInterface, tt.args.methods); !reflect.DeepEqual(got, tt.want) { + if got := newGenerateGRPCTransport(tt.args.name, tt.args.pbImportPath, tt.args.serviceInterface, tt.args.methods); !reflect.DeepEqual(got, tt.want) { t.Errorf("newGenerateGRPCTransport() = %v, want %v", got, tt.want) } }) diff --git a/generator/generate_client.go b/generator/generate_client.go index 0acb283..2b21850 100644 --- a/generator/generate_client.go +++ b/generator/generate_client.go @@ -22,6 +22,7 @@ type GenerateClient struct { transport string interfaceName string destPath string + pbImportPath string filePath string serviceDestPath string serviceFilePath string @@ -30,7 +31,7 @@ type GenerateClient struct { } // NewGenerateClient returns a client generator. -func NewGenerateClient(name string, transport string) Gen { +func NewGenerateClient(name string, transport, pbImportPath string) Gen { i := &GenerateClient{ name: name, interfaceName: utils.ToCamelCase(name + "Service"), @@ -41,6 +42,7 @@ func NewGenerateClient(name string, transport string) Gen { i.serviceFilePath = path.Join(i.serviceDestPath, viper.GetString("gk_service_file_name")) i.filePath = path.Join(i.destPath, viper.GetString("gk_service_file_name")) i.srcFile = jen.NewFilePath(i.destPath) + i.pbImportPath = pbImportPath i.InitPg() i.fs = fs.Get() return i @@ -83,7 +85,7 @@ func (g *GenerateClient) Generate() (err error) { return err } case "grpc": - cg := newGenerateGRPCClient(g.name, g.serviceInterface, g.serviceFile) + cg := newGenerateGRPCClient(g.name, g.pbImportPath, g.serviceInterface, g.serviceFile) err = cg.Generate() if err != nil { return err @@ -339,12 +341,13 @@ type generateGRPCClient struct { name string interfaceName string destPath string + pbImportPath string filePath string serviceInterface parser.Interface serviceFile *parser.File } -func newGenerateGRPCClient(name string, serviceInterface parser.Interface, serviceFile *parser.File) Gen { +func newGenerateGRPCClient(name, pbImportPath string, serviceInterface parser.Interface, serviceFile *parser.File) Gen { i := &generateGRPCClient{ name: name, interfaceName: utils.ToCamelCase(name + "Service"), @@ -354,6 +357,7 @@ func newGenerateGRPCClient(name string, serviceInterface parser.Interface, servi } i.filePath = path.Join(i.destPath, viper.GetString("gk_grpc_client_file_name")) i.srcFile = jen.NewFilePath(i.destPath) + i.pbImportPath = pbImportPath i.InitPg() i.fs = fs.Get() return i @@ -368,7 +372,7 @@ func (g *generateGRPCClient) Generate() (err error) { if err != nil { return err } - pbImport, err := utils.GetPbImportPath(g.name) + pbImport, err := utils.GetPbImportPath(g.name, g.pbImportPath) if err != nil { return err } diff --git a/generator/generate_service.go b/generator/generate_service.go index cb75c30..7cb88c7 100644 --- a/generator/generate_service.go +++ b/generator/generate_service.go @@ -22,6 +22,8 @@ type GenerateService struct { pg *PartialGenerator name string transport string + pbPath string + pbImportPath string interfaceName string serviceStructName string destPath string @@ -33,7 +35,7 @@ type GenerateService struct { } // NewGenerateService returns a initialized and ready generator. -func NewGenerateService(name, transport string, sMiddleware, gorillaMux, eMiddleware bool, methods []string) Gen { +func NewGenerateService(name, transport, pbPath, pbImportPath string, sMiddleware, gorillaMux, eMiddleware bool, methods []string) Gen { i := &GenerateService{ name: name, interfaceName: utils.ToCamelCase(name + "Service"), @@ -47,6 +49,10 @@ func NewGenerateService(name, transport string, sMiddleware, gorillaMux, eMiddle i.pg = NewPartialGenerator(nil) i.serviceStructName = utils.ToLowerFirstCamelCase(viper.GetString("gk_service_struct_prefix") + "-" + i.interfaceName) i.transport = transport + i.pbPath = pbPath + // If the `pbPath` was provided, the path to import pb will so difficult to determinate, so only pass it by flag directly. + i.pbImportPath = pbImportPath + // Not used. i.srcFile = jen.NewFilePath("") i.InitPg() @@ -112,7 +118,7 @@ func (g *GenerateService) Generate() (err error) { if err != nil { return err } - tp := NewGenerateTransport(g.name, g.gorillaMux, g.transport, g.methods) + tp := NewGenerateTransport(g.name, g.gorillaMux, g.transport, g.pbPath, g.pbImportPath, g.methods) err = tp.Generate() if err != nil { return err @@ -122,7 +128,7 @@ func (g *GenerateService) Generate() (err error) { if err != nil { return err } - mG := newGenerateCmd(g.name, g.serviceInterface, g.sMiddleware, g.eMiddleware, g.methods) + mG := newGenerateCmd(g.name, g.pbImportPath, g.serviceInterface, g.sMiddleware, g.eMiddleware, g.methods) return mG.Generate() } func (g *GenerateService) generateServiceMethods() { @@ -1475,6 +1481,7 @@ type generateCmd struct { file *parser.File interfaceName string destPath string + pbImportPath string filePath string httpDestPath string grpcDestPath string @@ -1485,7 +1492,7 @@ type generateCmd struct { serviceInterface parser.Interface } -func newGenerateCmd(name string, serviceInterface parser.Interface, +func newGenerateCmd(name, pbImportPath string, serviceInterface parser.Interface, generateSacDefaultsMiddleware bool, generateEndpointDefaultsMiddleware bool, methods []string) Gen { t := &generateCmd{ name: name, @@ -1502,6 +1509,7 @@ func newGenerateCmd(name string, serviceInterface parser.Interface, t.httpFilePath = path.Join(t.httpDestPath, viper.GetString("gk_http_file_name")) t.grpcFilePath = path.Join(t.grpcDestPath, viper.GetString("gk_grpc_file_name")) t.srcFile = jen.NewFile("service") + t.pbImportPath = pbImportPath t.InitPg() t.fs = fs.Get() return t @@ -1733,7 +1741,7 @@ func (g *generateCmd) generateRun() (*PartialGenerator, error) { ), jen.Defer().Qual( "github.com/lightstep/lightstep-tracer-go", "Flush", - ).Call(jen.Qual("context","Background").Call(), jen.Id("tracer")), + ).Call(jen.Qual("context", "Background").Call(), jen.Id("tracer")), ).Else().If(jen.Id("*appdashAddr").Op("!=").Lit("")).Block( jen.Id("logger").Dot("Log").Call( jen.Lit("tracer"), @@ -1946,7 +1954,7 @@ func (g *generateCmd) generateInitGRPC() (err error) { if err != nil { return err } - pbImport, err := utils.GetPbImportPath(g.name) + pbImport, err := utils.GetPbImportPath(g.name, g.pbImportPath) if err != nil { return err } diff --git a/generator/generator.go b/generator/generator.go index 2fc96d5..e8d31da 100644 --- a/generator/generator.go +++ b/generator/generator.go @@ -5,7 +5,6 @@ import ( "go/ast" ps "go/parser" "go/token" - "strings" "strconv" @@ -65,6 +64,7 @@ func (b *BaseGenerator) getMissingImports(imp []parser.NamedTypeValue, f *parser // CreateFolderStructure create folder structure of path func (b *BaseGenerator) CreateFolderStructure(path string) error { e, err := b.fs.Exists(path) + if err != nil { return err } diff --git a/go.mod b/go.mod index de82df1..f2dd624 100644 --- a/go.mod +++ b/go.mod @@ -3,13 +3,16 @@ module github.com/kujtimiihoxha/kit go 1.12 require ( + github.com/BurntSushi/toml v0.3.1 // indirect 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/inconshreveable/mousetrap v1.0.0 // indirect github.com/mattn/go-isatty v0.0.7 // indirect github.com/sirupsen/logrus v1.4.0 + github.com/smartystreets/goconvey v1.6.4 github.com/spf13/afero v1.2.2 github.com/spf13/cobra v0.0.3 github.com/spf13/viper v1.3.2 diff --git a/go.sum b/go.sum index 8fd48ff..e7fa93b 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 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= @@ -8,6 +10,7 @@ github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8Nz 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 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 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= @@ -16,8 +19,15 @@ github.com/emicklei/proto-contrib v0.0.0-20190206213850-73879796f936 h1:sXk80AaZ 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/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= 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/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= 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= @@ -27,9 +37,14 @@ github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQz 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 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 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/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= 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= @@ -44,6 +59,7 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn 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 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= 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= @@ -60,8 +76,10 @@ golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpbl 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-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 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 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= 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=