entity

package
v0.6.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2025 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UUID

func UUID() string

UUID() returns a randomly generated UUID string.

Types

type ResourceGroup

type ResourceGroup struct {
	Cluster     string            `json:"cluster,omitempty"     yaml:"cluster,omitempty"`
	APIVersion  string            `json:"apiVersion,omitempty"  yaml:"apiVersion,omitempty"`
	Kind        string            `json:"kind,omitempty"        yaml:"kind,omitempty"`
	Namespace   string            `json:"namespace,omitempty"   yaml:"namespace,omitempty"`
	Name        string            `json:"name,omitempty"        yaml:"name,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"      yaml:"labels,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
	Status      string            `json:"status,omitempty"      yaml:"status,omitempty"`
}

ResourceGroup represents information required to locate a resource or multi resources.

func NewResourceGroupFromQuery

func NewResourceGroupFromQuery(r *http.Request) (ResourceGroup, error)

NewResourceGroupFromQuery creates a ResourceGroup from an HTTP request query parameters.

Examples: - url?apiVersion=v1&kind=Pod&labels=app.kubernetes.io/name=mockapp,env=prod

func (*ResourceGroup) GetType

func (rg *ResourceGroup) GetType() (ResourceGroupType, bool)

GetType returns the type of ResourceGroup and a boolean indicating success.

func (*ResourceGroup) Hash

func (rg *ResourceGroup) Hash() ResourceGroupHash

Hash returns a unique string representation of the ResourceGroup that can be used as a cache key.

func (*ResourceGroup) ToSQL

func (rg *ResourceGroup) ToSQL() string

ToSQL generates a SQL query string based on the ResourceGroup.

func (*ResourceGroup) ToTerms added in v0.5.5

func (rg *ResourceGroup) ToTerms() map[string]any

ToTerms converts the ResourceGroup to ES query terms.

type ResourceGroupHash

type ResourceGroupHash string

ResourceGroupType represents the hash value of a ResourceGroup.

type ResourceGroupRule

type ResourceGroupRule struct {
	// ID is the id of the resourceGroupRule.
	ID string `yaml:"id" json:"id"`
	// Name is the name of the resourceGroupRule.
	Name string `yaml:"name" json:"name"`
	// Description is a human-readable description of the resourceGroupRule.
	Description string   `yaml:"description,omitempty" json:"description,omitempty"`
	Fields      []string `yaml:"fields,omitempty" json:"fields,omitempty"`
	// CreatedAt is the timestamp of the created for the resourceGroupRule.
	CreatedAt *metav1.Time `yaml:"createdAt,omitempty" json:"createdAt,omitempty"`
	// CreatedAt is the timestamp of the updated for the resourceGroupRule.
	UpdatedAt *metav1.Time `yaml:"updatedAt,omitempty" json:"updatedAt,omitempty"`
	// DeletedAt is the timestamp of the deleted for the resourceGroupRule.
	DeletedAt *metav1.Time `yaml:"deletedAt,omitempty" json:"deletedAt,omitempty"`
}

func (*ResourceGroupRule) Validate

func (e *ResourceGroupRule) Validate() error

Validate checks if the resourceGroupRule is valid. It returns an error if the resourceGroupRule is not valid.

type ResourceGroupType

type ResourceGroupType int

ResourceGroupType represents the type of a ResourceGroup.

const (
	Cluster ResourceGroupType = iota
	GVK
	Namespace
	ClusterGVKNamespace
	Resource
	NonNamespacedResource
	Custom
)

Enumerated constants representing different types of ResourceGroups.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL