models

package
v0.9.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	// The complete provider address.
	URL string
	// The host of the provider registry.
	Host string
	// The namespace of the provider.
	Namespace string
	// The name of the provider.
	Name string
	// The version of the provider.
	Version string
}

Provider records the information of the Terraform provider used to provision cloud resources.

func (*Provider) SetString

func (provider *Provider) SetString(providerURL string) error

SetString sets the attributes into the provider object.

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.
	ID string `json:"id" yaml:"id"`

	// Type represents all Runtimes we supported
	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) 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 Spec

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

Spec represents desired state of resources in one stack and will be applied to the actual infrastructure by the Kusion Engine

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