Documentation
¶
Index ¶
- Constants
- Variables
- func FindGraphResourceByID(gr *v1.GraphResources, id string) *v1.GraphResource
- func FindGraphResourceCollectionByID(gr *v1.GraphResources, id string) map[string]*v1.GraphResource
- func GenerateGraph(resources v1.Resources, gph *v1.Graph) (*v1.Graph, error)
- func RemoveResource(gph *v1.Graph, resource *v1.GraphResource)
- func RemoveResourceIndex(gph *v1.Graph)
- func UpdateResourceIndex(graphResources *v1.GraphResources)
- func ValidateGraph(graph *v1.Graph) error
- type ResourceInfo
- type Storage
Constants ¶
const ( AWSProviderType = "aws" AliCloudProviderType = "alicloud" AzureProviderType = "azure" GoogleProviderType = "google" AntProviderType = "ant" // AntProviderRegistrySuffix = "alipay.com" CustomProviderType = "custom" )
Variables ¶
Functions ¶
func FindGraphResourceByID ¶
func FindGraphResourceByID(gr *v1.GraphResources, id string) *v1.GraphResource
FindGraphResourceByID searches for a GraphResource by its ID in the resource index. If the resource is found, it returns the corresponding GraphResource. Otherwise, it returns nil.
func FindGraphResourceCollectionByID ¶
func FindGraphResourceCollectionByID(gr *v1.GraphResources, id string) map[string]*v1.GraphResource
FindGraphResourceCollectionByID retrieves the resource collection for a specific resource ID. It returns the collection (category) to which the resource belongs or nil if the resource is not found.
func GenerateGraph ¶
GenerateGraph generate a new graph from resources in the spec before apply operation is applied.
func RemoveResource ¶
func RemoveResource(gph *v1.Graph, resource *v1.GraphResource)
RemoveResource removes a GraphResource from its category and the global resource index.
func RemoveResourceIndex ¶
RemoveResourceIndex clears the entire resource index of the Graph.
func UpdateResourceIndex ¶
func UpdateResourceIndex(graphResources *v1.GraphResources)
UpdateResourceIndex updates the global resource index for all resources in GraphResources.
func ValidateGraph ¶
ValidateGraph checks the validity of a Graph object. It ensures that the essential fields within the Graph structure are not empty or nil. If any of the required fields are missing, an appropriate error is returned.
Types ¶
type ResourceInfo ¶
func GetResourceInfo ¶
func GetResourceInfo(resource *v1.Resource) (*ResourceInfo, error)
GetResourceInfo gets all the essential information for a resource to populate into the resource graph.
type Storage ¶
type Storage interface { // Get returns a specified Graph. Get() (*v1.Graph, error) // Create creates a new Graph in the Storage. Create(*v1.Graph) error // Update updates an existing Graph in the Storage. Update(*v1.Graph) error // Delete deletes an existing Graph in the Storage. Delete() error // CheckGraphStorageExistence checks if the Graph storage exists. CheckGraphStorageExistence() bool }
Storage is used to provide storage service for multiple Releases of a specified Project and Workspace.