entity

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

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"`
}

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.

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