Documentation ¶
Index ¶
- Constants
- func Map2ResourceGroupRule(in map[string]interface{}) (*entity.ResourceGroupRule, error)
- type AggregateResults
- type Bucket
- type Pagination
- type Query
- type Resource
- type ResourceGroupResult
- type ResourceGroupRuleStorage
- type ResourceGroupRuleStorageGetter
- type ResourceStorage
- type ResourceStorageGetter
- type SearchResult
- type SearchStorage
- type SearchStorageGetter
- type Storage
Constants ¶
const ( Equals = "=" DSLPatternType = "dsl" SQLPatternType = "sql" )
Variables ¶
This section is empty.
Functions ¶
func Map2ResourceGroupRule ¶
func Map2ResourceGroupRule(in map[string]interface{}) (*entity.ResourceGroupRule, error)
Map2ResourceGroupRule converts a map to a ResourceGroupRule object.
Types ¶
type AggregateResults ¶
AggregateResults is assumed to be a struct that holds aggregation results.
type Pagination ¶
Pagination defines the parameters for pagination in search results.
type Resource ¶
type Resource struct { entity.ResourceGroup `json:",inline" yaml:",inline"` Object map[string]interface{} `json:"object"` }
Resource represents a Kubernetes resource with additional metadata.
func Map2Resource ¶
Map2Resource converts a map to a Resource object.
type ResourceGroupResult ¶
type ResourceGroupResult struct { Groups []*entity.ResourceGroup `json:"groups" yaml:"groups"` Fields []string `json:"fields" yaml:"fields"` }
type ResourceGroupRuleStorage ¶
type ResourceGroupRuleStorage interface { GetResourceGroupRule(ctx context.Context, name string) (*entity.ResourceGroupRule, error) SaveResourceGroupRule(ctx context.Context, data *entity.ResourceGroupRule) error DeleteResourceGroupRule(ctx context.Context, name string) error ListResourceGroupRules(ctx context.Context) ([]*entity.ResourceGroupRule, error) CountResourceGroupRules(ctx context.Context) (int, error) ListResourceGroupsBy(ctx context.Context, ruleName string) (*ResourceGroupResult, error) }
ResourceGroupRuleStorage interface defines the basic operations for resource group rule storage.
type ResourceGroupRuleStorageGetter ¶
type ResourceGroupRuleStorageGetter interface {
GetResourceGroupRuleStorage() (ResourceGroupRuleStorage, error)
}
type ResourceStorage ¶
type ResourceStorage interface { GetResource(ctx context.Context, cluster string, obj runtime.Object) error SaveResource(ctx context.Context, cluster string, obj runtime.Object) error DeleteResource(ctx context.Context, cluster string, obj runtime.Object) error DeleteAllResources(ctx context.Context, cluster string) error CountResources(ctx context.Context) (int, error) }
ResourceStorage interface defines the basic operations for resource storage.
type ResourceStorageGetter ¶
type ResourceStorageGetter interface {
GetResourceStorage() (ResourceStorage, error)
}
type SearchResult ¶
SearchResult contains the search results and total count.
func (*SearchResult) Overview ¶
func (r *SearchResult) Overview() string
Overview returns a brief summary of the search result.
func (*SearchResult) ToYAML ¶
func (r *SearchResult) ToYAML() (string, error)
ToYAML returns the search result in YAML format.
type SearchStorage ¶
type SearchStorage interface { Search(ctx context.Context, queryString, patternType string, pagination *Pagination) (*SearchResult, error) SearchByTerms(ctx context.Context, keysAndValues map[string]any, pagination *Pagination) (*SearchResult, error) AggregateByTerms(ctx context.Context, keys []string) (*AggregateResults, error) }
SearchStorage interface defines the basic operations for search storage.
type SearchStorageGetter ¶
type SearchStorageGetter interface {
GetSearchStorage() (SearchStorage, error)
}
type Storage ¶
type Storage interface { ResourceStorage ResourceGroupRuleStorage SearchStorage }
Storage interface defines the basic operations for storage.