Skip to content

Commit

Permalink
chore(deps): bump go-apiops to 0.1.18 (#970)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tieske authored Jul 18, 2023
1 parent 7322889 commit e4a674c
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 17 deletions.
9 changes: 6 additions & 3 deletions cmd/file_addplugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ func executeAddPlugins(cmd *cobra.Command, cfgFiles []string) error {
trackInfo["selectors"] = cmdAddPluginsSelectors
deckformat.HistoryAppend(jsondata, trackInfo)

return filebasics.WriteSerializedFile(cmdAddPluginOutputFilename, jsondata, cmdAddPluginOutputFormat)
return filebasics.WriteSerializedFile(
cmdAddPluginOutputFilename,
jsondata,
filebasics.OutputFormat(cmdAddPluginOutputFormat))
}

//
Expand Down Expand Up @@ -151,8 +154,8 @@ order they are given:
"exist in an array. The default behavior is to skip existing plugins.")
addPluginsCmd.Flags().StringVarP(&cmdAddPluginOutputFilename, "output-file", "o", "-",
"Output file to write to. Use - to write to stdout.")
addPluginsCmd.Flags().StringVarP(&cmdAddPluginOutputFormat, "format", "", filebasics.OutputFormatYaml,
"Output format: "+filebasics.OutputFormatJSON+" or "+filebasics.OutputFormatYaml)
addPluginsCmd.Flags().StringVarP(&cmdAddPluginOutputFormat, "format", "", string(filebasics.OutputFormatYaml),
"Output format: "+string(filebasics.OutputFormatJSON)+" or "+string(filebasics.OutputFormatYaml))

return addPluginsCmd
}
6 changes: 3 additions & 3 deletions cmd/file_addtags.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func executeAddTags(cmd *cobra.Command, tagsToAdd []string) error {
trackInfo["selectors"] = cmdAddTagsSelectors
deckformat.HistoryAppend(data, trackInfo)

return filebasics.WriteSerializedFile(cmdAddTagsOutputFilename, data, cmdAddTagsOutputFormat)
return filebasics.WriteSerializedFile(cmdAddTagsOutputFilename, data, filebasics.OutputFormat(cmdAddTagsOutputFormat))
}

//
Expand Down Expand Up @@ -82,8 +82,8 @@ selectors are given, all Kong entities are tagged.`,
"Defaults to all Kong entities. Repeat for multiple selectors.")
addTagsCmd.Flags().StringVarP(&cmdAddTagsOutputFilename, "output-file", "o", "-",
"Output file to write to. Use - to write to stdout.")
addTagsCmd.Flags().StringVarP(&cmdAddTagsOutputFormat, "format", "", filebasics.OutputFormatYaml,
"Output format: "+filebasics.OutputFormatJSON+" or "+filebasics.OutputFormatYaml)
addTagsCmd.Flags().StringVarP(&cmdAddTagsOutputFormat, "format", "", string(filebasics.OutputFormatYaml),
"Output format: "+string(filebasics.OutputFormatJSON)+" or "+string(filebasics.OutputFormatYaml))

return addTagsCmd
}
8 changes: 6 additions & 2 deletions cmd/file_listtags.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ func executeListTags(cmd *cobra.Command, _ []string) error {
// return as yaml/json, create an object containing only a tags-array
result := make(map[string]interface{})
result["tags"] = list
return filebasics.WriteSerializedFile(cmdListTagsOutputFilename, result, cmdListTagsOutputFormat)
return filebasics.WriteSerializedFile(
cmdListTagsOutputFilename,
result,
filebasics.OutputFormat(cmdListTagsOutputFormat))
}

//
Expand Down Expand Up @@ -84,7 +87,8 @@ selectors are given, all Kong entities will be scanned.`,
ListTagsCmd.Flags().StringVarP(&cmdListTagsOutputFilename, "output-file", "o", "-",
"Output file to write to. Use - to write to stdout.")
ListTagsCmd.Flags().StringVarP(&cmdListTagsOutputFormat, "format", "", PlainOutputFormat,
"Output format: "+filebasics.OutputFormatJSON+", "+filebasics.OutputFormatYaml+", or "+PlainOutputFormat)
"Output format: "+string(filebasics.OutputFormatJSON)+", "+string(filebasics.OutputFormatYaml)+
", or "+string(PlainOutputFormat))

return ListTagsCmd
}
5 changes: 4 additions & 1 deletion cmd/file_merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ func executeMerge(cmd *cobra.Command, args []string) error {
deckformat.HistoryClear(merged)
deckformat.HistoryAppend(merged, historyEntry)

return filebasics.WriteSerializedFile(cmdMergeOutputFilename, merged, cmdMergeOutputFormat)
return filebasics.WriteSerializedFile(
cmdMergeOutputFilename,
merged,
filebasics.OutputFormat(cmdMergeOutputFormat))
}

//
Expand Down
2 changes: 1 addition & 1 deletion cmd/file_openapi2kong.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func executeOpenapi2Kong(cmd *cobra.Command, _ []string) error {
return fmt.Errorf("failed converting OpenAPI spec '%s'; %w", cmdO2KinputFilename, err)
}
deckformat.HistoryAppend(result, trackInfo)
return filebasics.WriteSerializedFile(cmdO2KoutputFilename, result, cmdO2KoutputFormat)
return filebasics.WriteSerializedFile(cmdO2KoutputFilename, result, filebasics.OutputFormat(cmdO2KoutputFormat))
}

//
Expand Down
2 changes: 1 addition & 1 deletion cmd/file_patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func executePatch(cmd *cobra.Command, args []string) error {

data = jsonbasics.ConvertToJSONobject(yamlNode)

return filebasics.WriteSerializedFile(cmdPatchOutputFilename, data, cmdPatchOutputFormat)
return filebasics.WriteSerializedFile(cmdPatchOutputFilename, data, filebasics.OutputFormat(cmdPatchOutputFormat))
}

//
Expand Down
9 changes: 6 additions & 3 deletions cmd/file_removetags.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ func executeRemoveTags(cmd *cobra.Command, tagsToRemove []string) error {
trackInfo["selectors"] = cmdRemoveTagsSelectors
deckformat.HistoryAppend(data, trackInfo)

return filebasics.WriteSerializedFile(cmdRemoveTagsOutputFilename, data, cmdRemoveTagsOutputFormat)
return filebasics.WriteSerializedFile(
cmdRemoveTagsOutputFilename,
data,
filebasics.OutputFormat(cmdRemoveTagsOutputFormat))
}

//
Expand Down Expand Up @@ -102,8 +105,8 @@ If no selectors are given, all Kong entities are selected.`,
"Defaults to all Kong entities. Repeat for multiple selectors.")
removeTagsCmd.Flags().StringVarP(&cmdRemoveTagsOutputFilename, "output-file", "o", "-",
"Output file to write. Use - to write to stdout.")
removeTagsCmd.Flags().StringVarP(&cmdRemoveTagsOutputFormat, "format", "", filebasics.OutputFormatYaml,
"Output format: "+filebasics.OutputFormatJSON+" or "+filebasics.OutputFormatYaml)
removeTagsCmd.Flags().StringVarP(&cmdRemoveTagsOutputFormat, "format", "", string(filebasics.OutputFormatYaml),
"Output format: "+string(filebasics.OutputFormatJSON)+" or "+string(filebasics.OutputFormatYaml))

return removeTagsCmd
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/hashicorp/go-retryablehttp v0.7.4
github.com/hexops/gotextdiff v1.0.3
github.com/imdario/mergo v0.3.16
github.com/kong/go-apiops v0.1.17
github.com/kong/go-apiops v0.1.18
github.com/kong/go-kong v0.44.0
github.com/mitchellh/go-homedir v1.1.0
github.com/shirou/gopsutil/v3 v3.23.6
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kong/go-apiops v0.1.17 h1:ChR7tW1sXSM0RNLFiPwvytksgO0rsoiMi/ipkXutj0A=
github.com/kong/go-apiops v0.1.17/go.mod h1:3P9DBGLcU6Gp4wo8z4xohcg8PMutBAknc54pLZoQtDs=
github.com/kong/go-apiops v0.1.18 h1:Bk6m3B9m8R0iykEyzpQa5rCHkhFGUpaXixFmaw/W3PM=
github.com/kong/go-apiops v0.1.18/go.mod h1:3P9DBGLcU6Gp4wo8z4xohcg8PMutBAknc54pLZoQtDs=
github.com/kong/go-kong v0.44.0 h1:1x3w/TYdJjIZ6c1j9HiYP8755c923XN2O6j3kEaUkTA=
github.com/kong/go-kong v0.44.0/go.mod h1:41Sot1N/n8UHBp+gE/6nOw3vuzoHbhMSyU/zOS7VzPE=
github.com/kong/semver/v4 v4.0.1 h1:DIcNR8W3gfx0KabFBADPalxxsp+q/5COwIFkkhrFQ2Y=
Expand Down

0 comments on commit e4a674c

Please sign in to comment.