intent

package
v0.9.1-rc.2 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ResourceExtensionGVK is the key for resource extension, which is used to
	// store the GVK of the resource.
	ResourceExtensionGVK = "GVK"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Intent

type Intent struct {
	Resources Resources `json:"resources" yaml:"resources"`
}

Intent represents the operational intentions that you aim to deliver using Kusion. These intentions are expected to contain all components throughout the software development lifecycle (SDLC), including resources (workload, database, load balancer, etc.), dependencies, and policies. The Kusion module generators are responsible for converting all AppConfigurations and environment configurations into the Intent. Once the Intent is generated, the Kusion Engine takes charge of updating the actual infrastructures to match the Intent.

type Resource

type Resource struct {
	// ID is the unique key of this resource in the whole State.
	// ApiVersion:Kind:Namespace:Name is an idiomatic way for Kubernetes resources.
	// providerNamespace:providerName:resourceType:resourceName for Terraform resources
	ID string `json:"id" yaml:"id"`

	// Type represents all Runtimes we supported like Kubernetes and Terraform
	Type Type `json:"type" yaml:"type"`

	// Attributes represents all specified attributes of this resource
	Attributes map[string]interface{} `json:"attributes" yaml:"attributes"`

	// DependsOn contains all resources this resource depends on
	DependsOn []string `json:"dependsOn,omitempty" yaml:"dependsOn,omitempty"`

	// Extensions specifies arbitrary metadata of this resource
	Extensions map[string]interface{} `json:"extensions,omitempty" yaml:"extensions,omitempty"`
}

func (*Resource) DeepCopy

func (r *Resource) DeepCopy() *Resource

DeepCopy return a copy of resource

func (*Resource) ResourceKey

func (r *Resource) ResourceKey() string

type Resources

type Resources []Resource

func (Resources) GVKIndex

func (rs Resources) GVKIndex() map[string][]*Resource

GVKIndex returns a map of GVK to resources, for now, only Kubernetes resources.

func (Resources) Index

func (rs Resources) Index() map[string]*Resource

func (Resources) Len

func (rs Resources) Len() int

func (Resources) Less

func (rs Resources) Less(i, j int) bool

func (Resources) Swap

func (rs Resources) Swap(i, j int)

type Type

type Type string
const (
	Kubernetes Type = "Kubernetes"
	Terraform  Type = "Terraform"
)

Jump to

Keyboard shortcuts

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