Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated filter methods #133

Merged
merged 11 commits into from
Jun 27, 2022
9 changes: 9 additions & 0 deletions pkg/selector/selector.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ func (itf Selector) Save() error {

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

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

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