Skip to content

Commit 8ac398b

Browse files
digocorbelliniRodrigo Okamoto
andauthored
Deprecated filter methods (#133)
* fixed issue with OD pricing for european regions * made string replacement more readable in getRegionForPricingAPI * implemented sorting of instance types * fixed typo in filtering error message * moved sort to selector.go and refactored FilterVerbose tests * brought back FilterWithOutput() in selector.go * working implementation of refactoring solution * Deprecated the filter methods in selector.go * added the names of replacement functions to deprecated comments Co-authored-by: Rodrigo Okamoto <rodocp@amazon.com>
1 parent 69ef9dd commit 8ac398b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/selector/selector.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ func (itf Selector) Save() error {
132132

133133
// Filter accepts a Filters struct which is used to select the available instance types
134134
// matching the criteria within Filters and returns a simple list of instance type strings
135+
//
136+
// Deprecated: This function will be replaced with GetFilteredInstanceTypes() and
137+
// OutputInstanceTypes() in the next major version.
135138
func (itf Selector) Filter(filters Filters) ([]string, error) {
136139
outputFn := InstanceTypesOutputFn(outputs.SimpleInstanceTypeOutput)
137140
output, _, err := itf.FilterWithOutput(filters, outputFn)
@@ -140,6 +143,9 @@ func (itf Selector) Filter(filters Filters) ([]string, error) {
140143

141144
// FilterVerbose accepts a Filters struct which is used to select the available instance types
142145
// matching the criteria within Filters and returns a list instanceTypeInfo
146+
//
147+
// Deprecated: This function will be replaced with GetFilteredInstanceTypes() in the next
148+
// major version.
143149
func (itf Selector) FilterVerbose(filters Filters) ([]*instancetypes.Details, error) {
144150
instanceTypeInfoSlice, err := itf.rawFilter(filters)
145151
if err != nil {
@@ -151,6 +157,9 @@ func (itf Selector) FilterVerbose(filters Filters) ([]*instancetypes.Details, er
151157

152158
// FilterWithOutput accepts a Filters struct which is used to select the available instance types
153159
// matching the criteria within Filters and returns a list of strings based on the custom outputFn
160+
//
161+
// Deprecated: This function will be replaced with GetFilteredInstanceTypes() and
162+
// OutputInstanceTypes() in the next major version.
154163
func (itf Selector) FilterWithOutput(filters Filters, outputFn InstanceTypesOutput) ([]string, int, error) {
155164
instanceTypeInfoSlice, err := itf.rawFilter(filters)
156165
if err != nil {

0 commit comments

Comments
 (0)