entity

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: Apache-2.0 Imports: 8 Imported by: 11

Documentation

Index

Constants

View Source
const (
	SecretProviderTypeAliCloud   = "kam.v1.secretproviders.AlicloudProvider"
	SecretProviderTypeAWS        = "kam.v1.secretproviders.AWSProvider"
	SecretProviderTypeVault      = "kam.v1.secretproviders.VaultProvider"
	SecretProviderTypeAzureKV    = "kam.v1.secretproviders.AzureKVProvider"
	SecretProviderTypeOnPremises = "kam.v1.secretproviders.OnPremisesProvider"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// ID is the id of the backend.
	ID uint `yaml:"id" json:"id"`
	// Name is the name of the backend.
	Name string `yaml:"name" json:"name"`
	// // Type is the type of the backend.
	// Type string `yaml:"type" json:"type"`
	// Backend is the configuration of the backend.
	BackendConfig v1.BackendConfig `yaml:"backendConfig" json:"backendConfig"`
	// Description is a human-readable description of the backend.
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
	// CreationTimestamp is the timestamp of the created for the backend.
	CreationTimestamp time.Time `yaml:"creationTimestamp,omitempty" json:"creationTimestamp,omitempty"`
	// UpdateTimestamp is the timestamp of the updated for the backend.
	UpdateTimestamp time.Time `yaml:"updateTimestamp,omitempty" json:"updateTimestamp,omitempty"`
}

Backend represents the specific configuration backend

func (*Backend) Validate

func (w *Backend) Validate() error

Validate checks if the backend is valid. It returns an error if the backend is not valid.

type GetConfig

type GetConfig struct {
	Paths []string
	Type  *constant.SourceProviderType
}

type GetOption

type GetOption func(opt *GetConfig)

func WithPaths

func WithPaths(paths ...string) GetOption

func WithType

type Organization

type Organization struct {
	// ID is the id of the organization.
	ID uint `yaml:"id" json:"id"`
	// Name is the name of the organization.
	Name string `yaml:"name" json:"name"`
	// DisplayName is the human-readable display name.
	DisplayName string `yaml:"displayName,omitempty" json:"displayName,omitempty"`
	// Description is a human-readable description of the organization.
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
	// Labels are custom labels associated with the organization.
	Labels []string `yaml:"labels,omitempty" json:"labels,omitempty"`
	// Owners is a list of owners for the organization.
	Owners []string `yaml:"owners,omitempty" json:"owners,omitempty"`
	// CreationTimestamp is the timestamp of the created for the organization.
	CreationTimestamp time.Time `yaml:"creationTimestamp,omitempty" json:"creationTimestamp,omitempty"`
	// UpdateTimestamp is the timestamp of the updated for the organization.
	UpdateTimestamp time.Time `yaml:"updateTimestamp,omitempty" json:"updateTimestamp,omitempty"`
}

Organization represents the specific configuration organization

func (*Organization) Validate

func (p *Organization) Validate() error

Validate checks if the organization is valid. It returns an error if the organization is not valid.

type Project

type Project struct {
	// ID is the id of the project.
	ID uint `yaml:"id" json:"id"`
	// Name is the name of the project.
	Name string `yaml:"name" json:"name"`
	// DisplayName is the human-readable display name.
	DisplayName string `yaml:"displayName,omitempty" json:"displayName,omitempty"`
	// Source is the configuration source associated with the project.
	Source *Source `yaml:"source" json:"source"`
	// Organization is the configuration source associated with the project.
	Organization *Organization `yaml:"organization" json:"organization"`
	// Description is a human-readable description of the project.
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
	// Path is the relative path of the project within the sources.
	Path string `yaml:"path,omitempty" json:"path,omitempty"`
	// Labels are custom labels associated with the project.
	Labels []string `yaml:"labels,omitempty" json:"labels,omitempty"`
	// Owners is a list of owners for the project.
	Owners []string `yaml:"owners,omitempty" json:"owners,omitempty"`
	// CreationTimestamp is the timestamp of the created for the project.
	CreationTimestamp time.Time `yaml:"creationTimestamp,omitempty" json:"creationTimestamp,omitempty"`
	// UpdateTimestamp is the timestamp of the updated for the project.
	UpdateTimestamp time.Time `yaml:"updateTimestamp,omitempty" json:"updateTimestamp,omitempty"`
}

Project represents the specific configuration project

func (*Project) ConvertToCore

func (p *Project) ConvertToCore() *v1.Project

Convert Project to core Project

func (*Project) Validate

func (p *Project) Validate() error

Validate checks if the project is valid. It returns an error if the project is not valid.

type ProjectFilter added in v0.13.0

type ProjectFilter struct {
	OrgID uint
	Name  string
}

type Resource added in v0.13.0

type Resource struct {
	// ID is the id of the resource.
	ID uint `yaml:"id" json:"id"`
	// Stack is the stack associated with the resource.
	Stack *Stack `yaml:"stack" json:"stack"`
	// ResourceType is the type of the resource.
	ResourceType string `yaml:"resourceType" json:"resourceType"`
	// ResourcePlane is the plane of the resource.
	ResourcePlane string `yaml:"resourcePlane" json:"resourcePlane"`
	// ResourceName is the name of the resource.
	ResourceName string `yaml:"resourceName" json:"resourceName"`
	// KusionResourceID is the id of the resource in Kusion.
	KusionResourceID string `yaml:"kusionResourceID" json:"kusionResourceID"`
	// IAMResourceID is the id of the resource in IAM.
	IAMResourceID string `yaml:"iamResourceID" json:"iamResourceID"`
	// CloudResourceID is the id of the resource in the cloud.
	CloudResourceID string `yaml:"cloudResourceID" json:"cloudResourceID"`
	// LastAppliedRevision is the revision of the last sync.
	LastAppliedRevision string `yaml:"LastAppliedRevision" json:"LastAppliedRevision"`
	// LastAppliedTimestamp is the timestamp of the last sync.
	LastAppliedTimestamp time.Time `yaml:"LastAppliedTimestamp" json:"LastAppliedTimestamp"`
	// Status is the status of the resource.
	Status string `yaml:"status" json:"status"`
	// Attributes is the attributes of the resource.
	Attributes map[string]interface{} `yaml:"attributes,omitempty" json:"attributes,omitempty"`
	// Provider is the provider of the resource.
	Provider string `yaml:"provider" json:"provider"`
	// Labels are custom labels associated with the resource.
	Labels []string `yaml:"labels,omitempty" json:"labels,omitempty"`
	// Owners is a list of owners for the resource.
	Owners []string `yaml:"owners,omitempty" json:"owners,omitempty"`
	// CreationTimestamp is the timestamp of the created for the resource.
	CreationTimestamp time.Time `yaml:"creationTimestamp,omitempty" json:"creationTimestamp,omitempty"`
	// UpdateTimestamp is the timestamp of the updated for the resource.
	UpdateTimestamp time.Time `yaml:"updateTimestamp,omitempty" json:"updateTimestamp,omitempty"`
}

Resource represents the specific configuration code resource, which should be a specific instance of the resource provider.

func (*Resource) Validate added in v0.13.0

func (r *Resource) Validate() error

Validate checks if the resource is valid. It returns an error if the resource is not valid.

type ResourceFilter added in v0.13.0

type ResourceFilter struct {
	OrgID            uint
	ProjectID        uint
	StackID          uint
	ResourcePlane    string
	ResourceType     string
	KusionResourceID string
	Status           string
}

type SecretStore added in v0.13.0

type SecretStore struct {
	ProviderType string         `json:"providerType"`
	Provider     map[string]any `json:"provider"`
}

func (*SecretStore) ConvertToKusionSecretStore added in v0.13.0

func (s *SecretStore) ConvertToKusionSecretStore() (*v1.SecretStore, error)

type SecretValue added in v0.13.0

type SecretValue struct {
	SecretStore *SecretStore `json:"secretStore"`
	// Value to store in the secret store.
	Value string `json:"value"`
	// Ref will only return with the update secret variable
	Ref string `json:"ref"`
}

type Source

type Source struct {
	// ID is the id of the source.
	ID uint `yaml:"id" json:"id"`
	// SourceProvider is the type of the source provider.
	SourceProvider constant.SourceProviderType `yaml:"sourceProvider" json:"sourceProvider"`
	// Remote is the source URL, including scheme.
	Remote *url.URL `yaml:"remote" json:"remote"`
	// Description is a human-readable description of the source.
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
	// Labels are custom labels associated with the source.
	Labels []string `yaml:"labels,omitempty" json:"labels,omitempty"`
	// Owners is a list of owners for the source.
	Owners []string `yaml:"owners,omitempty" json:"owners,omitempty"`
	// CreationTimestamp is the timestamp of the created for the source.
	CreationTimestamp time.Time `yaml:"creationTimestamp,omitempty" json:"creationTimestamp,omitempty"`
	// UpdateTimestamp is the timestamp of the updated for the source.
	UpdateTimestamp time.Time `yaml:"updateTimestamp,omitempty" json:"updateTimestamp,omitempty"`
}

Source represents the specific configuration code source, which should be a specific instance of the source provider.

func (*Source) Summary

func (s *Source) Summary() string

func (*Source) Validate

func (s *Source) Validate() error

Validate checks if the source is valid. It returns an error if the source is not valid.

type SourceProvider

type SourceProvider interface {
	// Get the type of the source provider.
	Type() constant.SourceProviderType
	// Get source and return directory.
	Get(ctx context.Context, opts ...GetOption) (string, error)
	// Cleanup is invoked to cleanup temp resources for the source.
	Cleanup(ctx context.Context)
}

The SourceProvider represents the abstraction of the source provider(s) management framework.

type Stack

type Stack struct {
	// ID is the id of the stack.
	ID uint `yaml:"id" json:"id"`
	// Name is the name of the stack.
	Name string `yaml:"name" json:"name"`
	// Type is the type of the stack.
	Type string `yaml:"type" json:"type"`
	// DisplayName is the human-readable display nams.
	DisplayName string `yaml:"displayName,omitempty" json:"displayName,omitempty"`
	// Project is the project associated with the stack.
	Project *Project `yaml:"project" json:"project"`
	// Desired is the desired version of stack.
	DesiredVersion string `yaml:"desiredVersion" json:"desiredVersion"`
	// Description is a human-readable description of the stack.
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
	// Path is the relative path of the stack within the sourcs.
	Path string `yaml:"path,omitempty" json:"path,omitempty"`
	// Labels are custom labels associated with the stack.
	Labels []string `yaml:"labels,omitempty" json:"labels,omitempty"`
	// Owners is a list of owners for the stack.
	Owners []string `yaml:"owners,omitempty" json:"owners,omitempty"`
	// SyncState is the current state of the stack.
	SyncState constant.StackState `yaml:"syncState" json:"syncState"`
	// LastGeneratedRevision is the spec ID of the last generate operation for the stack.
	LastGeneratedRevision string `yaml:"lastGeneratedRevision" json:"lastGeneratedRevision"`
	// LastPreviewedRevision is the spec ID of the last preview operation for the stack.
	LastPreviewedRevision string `yaml:"lastPreviewedRevision" json:"lastPreviewedRevision"`
	// LastAppliedRevision is the spec ID of the last apply operation for the stack.
	LastAppliedRevision string `yaml:"lastAppliedRevision" json:"lastAppliedRevision"`
	// LastAppliedTimestamp is the timestamp of the last apply operation for the stack.
	LastAppliedTimestamp time.Time `yaml:"lastAppliedTimestamp,omitempty" json:"lastAppliedTimestamp,omitempty"`
	// CreationTimestamp is the timestamp of the created for the stack.
	CreationTimestamp time.Time `yaml:"creationTimestamp,omitempty" json:"creationTimestamp,omitempty"`
	// UpdateTimestamp is the timestamp of the updated for the stack.
	UpdateTimestamp time.Time `yaml:"updateTimestamp,omitempty" json:"updateTimestamp,omitempty"`
}

Stack represents the specific configuration stack

func (*Stack) ConvertToCore

func (s *Stack) ConvertToCore() *v1.Stack

Convert stack to core stack

func (*Stack) StackInOperation added in v0.13.0

func (s *Stack) StackInOperation() bool

func (*Stack) Validate

func (s *Stack) Validate() error

Validate checks if the stack is valid. It returns an error if the stack is not valid.

type StackFilter added in v0.13.0

type StackFilter struct {
	OrgID     uint
	ProjectID uint
	Path      string
}

type Workspace

type Workspace struct {
	// ID is the id of the workspace.
	ID uint `yaml:"id" json:"id"`
	// Name is the name of the workspace.
	Name string `yaml:"name" json:"name"`
	// DisplayName is the human-readable display name.
	DisplayName string `yaml:"displayName,omitempty" json:"displayName,omitempty"`
	// Description is a human-readable description of the workspace.
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
	// Labels are custom labels associated with the workspace.
	Labels []string `yaml:"labels,omitempty" json:"labels,omitempty"`
	// Owners is a list of owners for the workspace.
	Owners []string `yaml:"owners,omitempty" json:"owners,omitempty"`
	// CreationTimestamp is the timestamp of the created for the workspace.
	CreationTimestamp time.Time `yaml:"creationTimestamp,omitempty" json:"creationTimestamp,omitempty"`
	// UpdateTimestamp is the timestamp of the updated for the workspace.
	UpdateTimestamp time.Time `yaml:"updateTimestamp,omitempty" json:"updateTimestamp,omitempty"`
	// Backend is the corresponding backend for this workspace.
	Backend *Backend `yaml:"backend,omitempty" json:"backend,omitempty"`
}

Workspace represents the specific configuration workspace

func (*Workspace) Validate

func (w *Workspace) Validate() error

Validate checks if the workspace is valid. It returns an error if the workspace is not valid.

type WorkspaceFilter added in v0.13.0

type WorkspaceFilter struct {
	BackendID uint
	Name      string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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