deploy

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppOptions

type AppOptions struct {
	Image       string `json:"image" yaml:"image"`
	Environment string `json:"environment" yaml:"environment"`
	Replicas    int    `json:"replicas" yaml:"replicas"`
	Strategy    string `json:"strategy" yaml:"strategy"`
}

AppOptions represents application deployment options

type Deployer

type Deployer interface {
	DeployInfrastructure(options InfraOptions) (*DeploymentResult, error)
	DeployApplication(options AppOptions) (*DeploymentResult, error)
	ListDeployments() ([]*Deployment, error)
	GetDeploymentStatus(id string) (*DeploymentStatus, error)
	RollbackDeployment(id, version string) (*RollbackResult, error)
	GeneratePlan(options PlanOptions) (*DeploymentPlan, error)
}

Deployer interface defines deployment operations

func New

func New() (Deployer, error)

New creates a new deployer instance

type DeployerImpl

type DeployerImpl struct {
	// contains filtered or unexported fields
}

DeployerImpl implements the Deployer interface

func (*DeployerImpl) DeployApplication

func (d *DeployerImpl) DeployApplication(options AppOptions) (*DeploymentResult, error)

DeployApplication deploys an application

func (*DeployerImpl) DeployInfrastructure

func (d *DeployerImpl) DeployInfrastructure(options InfraOptions) (*DeploymentResult, error)

DeployInfrastructure deploys infrastructure

func (*DeployerImpl) GeneratePlan

func (d *DeployerImpl) GeneratePlan(options PlanOptions) (*DeploymentPlan, error)

GeneratePlan generates a deployment plan

func (*DeployerImpl) GetDeploymentStatus

func (d *DeployerImpl) GetDeploymentStatus(id string) (*DeploymentStatus, error)

GetDeploymentStatus gets the status of a specific deployment

func (*DeployerImpl) ListDeployments

func (d *DeployerImpl) ListDeployments() ([]*Deployment, error)

ListDeployments lists all deployments

func (*DeployerImpl) RollbackDeployment

func (d *DeployerImpl) RollbackDeployment(id, version string) (*RollbackResult, error)

RollbackDeployment rolls back a deployment

type Deployment

type Deployment struct {
	ID          string            `json:"id" yaml:"id"`
	Name        string            `json:"name" yaml:"name"`
	Type        string            `json:"type" yaml:"type"`
	Status      string            `json:"status" yaml:"status"`
	Environment string            `json:"environment" yaml:"environment"`
	Version     string            `json:"version" yaml:"version"`
	CreatedAt   time.Time         `json:"created_at" yaml:"created_at"`
	UpdatedAt   time.Time         `json:"updated_at" yaml:"updated_at"`
	Metadata    map[string]string `json:"metadata" yaml:"metadata"`
}

Deployment represents a deployment

type DeploymentPlan

type DeploymentPlan struct {
	Actions   []PlannedAction   `json:"actions" yaml:"actions"`
	Resources []PlannedResource `json:"resources" yaml:"resources"`
	Estimated EstimatedImpact   `json:"estimated" yaml:"estimated"`
	Warnings  []string          `json:"warnings" yaml:"warnings"`
	Metadata  map[string]string `json:"metadata" yaml:"metadata"`
	Timestamp time.Time         `json:"timestamp" yaml:"timestamp"`
}

DeploymentPlan represents a deployment plan

type DeploymentResult

type DeploymentResult struct {
	ID        string            `json:"id" yaml:"id"`
	Status    string            `json:"status" yaml:"status"`
	Message   string            `json:"message" yaml:"message"`
	Resources []string          `json:"resources" yaml:"resources"`
	Duration  time.Duration     `json:"duration" yaml:"duration"`
	Metadata  map[string]string `json:"metadata" yaml:"metadata"`
	Timestamp time.Time         `json:"timestamp" yaml:"timestamp"`
}

DeploymentResult represents the result of a deployment

type DeploymentStatus

type DeploymentStatus struct {
	ID         string            `json:"id" yaml:"id"`
	Status     string            `json:"status" yaml:"status"`
	Phase      string            `json:"phase" yaml:"phase"`
	Progress   int               `json:"progress" yaml:"progress"`
	Message    string            `json:"message" yaml:"message"`
	Resources  []ResourceStatus  `json:"resources" yaml:"resources"`
	LastUpdate time.Time         `json:"last_update" yaml:"last_update"`
	Metadata   map[string]string `json:"metadata" yaml:"metadata"`
}

DeploymentStatus represents the status of a deployment

type EstimatedImpact

type EstimatedImpact struct {
	Duration   time.Duration `json:"duration" yaml:"duration"`
	Downtime   time.Duration `json:"downtime" yaml:"downtime"`
	Cost       float64       `json:"cost" yaml:"cost"`
	Complexity string        `json:"complexity" yaml:"complexity"`
}

EstimatedImpact represents estimated deployment impact

type InfraOptions

type InfraOptions struct {
	Template  string            `json:"template" yaml:"template"`
	Optimize  bool              `json:"optimize" yaml:"optimize"`
	DryRun    bool              `json:"dry_run" yaml:"dry_run"`
	Variables map[string]string `json:"variables" yaml:"variables"`
}

InfraOptions represents infrastructure deployment options

type PlanOptions

type PlanOptions struct {
	Template string `json:"template" yaml:"template"`
	Optimize bool   `json:"optimize" yaml:"optimize"`
}

PlanOptions represents deployment plan options

type PlannedAction

type PlannedAction struct {
	Type        string            `json:"type" yaml:"type"`
	Resource    string            `json:"resource" yaml:"resource"`
	Action      string            `json:"action" yaml:"action"`
	Description string            `json:"description" yaml:"description"`
	Risk        string            `json:"risk" yaml:"risk"`
	Metadata    map[string]string `json:"metadata" yaml:"metadata"`
}

PlannedAction represents a planned deployment action

type PlannedResource

type PlannedResource struct {
	Name     string            `json:"name" yaml:"name"`
	Type     string            `json:"type" yaml:"type"`
	Action   string            `json:"action" yaml:"action"`
	Changes  []string          `json:"changes" yaml:"changes"`
	Metadata map[string]string `json:"metadata" yaml:"metadata"`
}

PlannedResource represents a planned resource

type ResourceStatus

type ResourceStatus struct {
	Name     string            `json:"name" yaml:"name"`
	Type     string            `json:"type" yaml:"type"`
	Status   string            `json:"status" yaml:"status"`
	Health   string            `json:"health" yaml:"health"`
	Metadata map[string]string `json:"metadata" yaml:"metadata"`
}

ResourceStatus represents the status of a deployed resource

type RollbackResult

type RollbackResult struct {
	ID          string            `json:"id" yaml:"id"`
	Status      string            `json:"status" yaml:"status"`
	Message     string            `json:"message" yaml:"message"`
	FromVersion string            `json:"from_version" yaml:"from_version"`
	ToVersion   string            `json:"to_version" yaml:"to_version"`
	Duration    time.Duration     `json:"duration" yaml:"duration"`
	Metadata    map[string]string `json:"metadata" yaml:"metadata"`
	Timestamp   time.Time         `json:"timestamp" yaml:"timestamp"`
}

RollbackResult represents the result of a rollback

Jump to

Keyboard shortcuts

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