graph

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AWSProviderType      = "aws"
	AliCloudProviderType = "alicloud"
	AzureProviderType    = "azure"
	GoogleProviderType   = "google"
	AntProviderType      = "ant"
	// AntProviderRegistrySuffix = "alipay.com"
	CustomProviderType = "custom"
)

Variables

View Source
var (
	ErrEmptyGraph         = errors.New("empty graph")
	ErrEmptyProject       = errors.New("empty project")
	ErrEmptyWorkspace     = errors.New("empty workspace")
	ErrEmptyResources     = errors.New("empty resources")
	ErrEmptyResourceIndex = errors.New("empty resource index")
)

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

func GenerateGraph(resources v1.Resources, gph *v1.Graph) (*v1.Graph, error)

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

func RemoveResourceIndex(gph *v1.Graph)

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

func ValidateGraph(graph *v1.Graph) error

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

type ResourceInfo struct {
	ResourceType    string
	CloudResourceID string
	ResourceName    string
}

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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