-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Bence Csati <csatib02@gmail.com>
- Loading branch information
Showing
13 changed files
with
53 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
package model | ||
|
||
import "github.com/csatib02/kube-pod-autocomplete/pkg/common" | ||
|
||
type AutoCompleteRequest struct { | ||
ResourceType ResourceType `json:"resourceType"` | ||
Filters []string `json:"filters"` | ||
Query string `json:"query"` // Currently not used | ||
ResourceType common.ResourceType `json:"resourceType"` | ||
Filters []string `json:"filters"` | ||
Query string `json:"query"` // Currently not used | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
package model | ||
|
||
import "github.com/csatib02/kube-pod-autocomplete/pkg/common" | ||
|
||
// FieldExtractor interface defines the method for extracting field values from a PodList | ||
// NOTE: There is no actual difference between ListExtractor and MapExtractor, | ||
// since when processing the extracted data, we can always check the type of the underlying data structure | ||
// via FieldFilter.Type, but for the sake of clarity, I have defined two separate types. | ||
type FieldExtractor interface { | ||
Extract(Resources) any | ||
} | ||
|
||
type ListExtractor func(resource Resources) interface{} | ||
|
||
func (e ListExtractor) Extract(resource Resources) interface{} { | ||
return e(resource) | ||
Extract(common.Resources) any | ||
} | ||
|
||
type MapExtractor func(resource Resources) interface{} | ||
type Extractor func(resource common.Resources) any | ||
|
||
func (e MapExtractor) Extract(resource Resources) interface{} { | ||
func (e Extractor) Extract(resource common.Resources) any { | ||
return e(resource) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package utils | ||
package log | ||
|
||
import ( | ||
"context" | ||
|