diff --git a/.travis.yml b/.travis.yml index b7d90d8..35701fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,11 @@ matrix: # tests pass on the stable versions of Go. fast_finish: true +cache: + directories: + - $GOPATH/pkg + - $GOPATH/bin + env: - DEP_VERSION="0.4.1" diff --git a/config/cmd/decrypt.go b/config/cmd/decrypt.go index 2761d9f..706fa4a 100644 --- a/config/cmd/decrypt.go +++ b/config/cmd/decrypt.go @@ -17,11 +17,12 @@ var decryptCmd = &cobra.Command{ Use: "decrypt", Short: "Decrypt the value server-side and prints the response", RunE: func(cmd *cobra.Command, args []string) error { - return executeDecrypt(args) + return ExecuteDecrypt(args) }, } -func executeDecrypt(args []string) error { +//ExecuteDecrypt runs decrypt cmd +func ExecuteDecrypt(args []string) error { if dp.value == "" { bytes, err := ioutil.ReadAll(os.Stdin) diff --git a/config/cmd/decrypt_test.go b/config/cmd/decrypt_test.go index b6766a8..e027f21 100644 --- a/config/cmd/decrypt_test.go +++ b/config/cmd/decrypt_test.go @@ -32,7 +32,7 @@ func TestExecuteDecrypt(t *testing.T) { dp.source = ts.URL dp.value = tp.testContent - err := executeDecrypt(nil) + err := ExecuteDecrypt(nil) if err != nil { t.Error("Decrypt failed with: ", err) @@ -55,6 +55,6 @@ func ExampleExecuteDecrypt() { dp.source = ts.URL dp.value = tp.testContent - executeDecrypt(nil) + ExecuteDecrypt(nil) //Output: test } diff --git a/config/cmd/encrypt.go b/config/cmd/encrypt.go index 5aea6ee..7be1458 100644 --- a/config/cmd/encrypt.go +++ b/config/cmd/encrypt.go @@ -17,11 +17,12 @@ var encryptCmd = &cobra.Command{ Use: "encrypt", Short: "Encrypt the value server-side and prints the response", RunE: func(cmd *cobra.Command, args []string) error { - return executeEncrypt(args) + return ExecuteEncrypt(args) }, } -func executeEncrypt(args []string) error { +//ExecuteEncrypt runs encrypt cmd +func ExecuteEncrypt(args []string) error { if ep.value == "" { bytes, err := ioutil.ReadAll(os.Stdin) diff --git a/config/cmd/encrypt_test.go b/config/cmd/encrypt_test.go index d318f36..3d7f1d5 100644 --- a/config/cmd/encrypt_test.go +++ b/config/cmd/encrypt_test.go @@ -32,7 +32,7 @@ func TestExecuteEncrypt(t *testing.T) { ep.source = ts.URL ep.value = tp.testContent - err := executeEncrypt(nil) + err := ExecuteEncrypt(nil) if err != nil { t.Error("Encrypt failed with: ", err) @@ -55,6 +55,6 @@ func ExampleExecuteEncrypt() { ep.source = ts.URL ep.value = tp.testContent - executeEncrypt(nil) + ExecuteEncrypt(nil) //Output: test } diff --git a/config/cmd/get.go b/config/cmd/get.go index abbcb31..29749ad 100644 --- a/config/cmd/get.go +++ b/config/cmd/get.go @@ -26,7 +26,7 @@ var getValuesCmd = &cobra.Command{ Use: "values", Short: "Get the config values in specified format from the given config server", RunE: func(cmd *cobra.Command, args []string) error { - return executeGetValues(args) + return ExecuteGetValues(args) }, } @@ -34,11 +34,12 @@ var getFilesCmd = &cobra.Command{ Use: "files", Short: "Get the config files from the given config server", RunE: func(cmd *cobra.Command, args []string) error { - return executeGetFiles(args) + return ExecuteGetFiles(args) }, } -func executeGetValues(args []string) error { +//ExecuteGetValues runs get values cmd +func ExecuteGetValues(args []string) error { ext, err := client.ParseExtension(gp.format) if err != nil { @@ -73,7 +74,8 @@ func executeGetValues(args []string) error { return nil } -func executeGetFiles(args []string) error { +//ExecuteGetFiles runs get files cmd +func ExecuteGetFiles(args []string) error { for _, mapping := range gp.fileMappings.Mappings() { resp, err := client. NewClient(client.Config{URI: gp.source, Profile: gp.profile, Application: gp.application, Label: gp.label}). diff --git a/config/cmd/get_test.go b/config/cmd/get_test.go index 64bbe63..153065a 100644 --- a/config/cmd/get_test.go +++ b/config/cmd/get_test.go @@ -11,7 +11,7 @@ import ( ) func TestNoArgExecute(t *testing.T) { - err := executeGetFiles(nil) + err := ExecuteGetFiles(nil) if err != nil { t.Error("Execute failed with: ", err) } @@ -68,7 +68,7 @@ func TestExecuteGetFiles(t *testing.T) { gp.fileMappings = FileMappings{mappings: make([]FileMapping, 1)} gp.fileMappings.mappings[0] = FileMapping{source: tp.srcFileName, destination: tp.destFileName} - if err := executeGetFiles(nil); err != nil { + if err := ExecuteGetFiles(nil); err != nil { t.Error("Execute failed with: ", err) } @@ -131,7 +131,7 @@ func TestExecuteGetValues(t *testing.T) { gp.source = ts.URL gp.destination = tp.destFileName - if err := executeGetValues(nil); err != nil { + if err := ExecuteGetValues(nil); err != nil { t.Error("Execute failed with: ", err) }