Documentation
¶
Index ¶
- type ConfigInfo
- type ContainerInfo
- type DeploymentState
- type EnvironmentState
- type GlobalState
- type HealthCheck
- type Manager
- func (m *Manager) CheckBuildCache(serviceName string, files map[string]string) (bool, error)
- func (m *Manager) Exists() bool
- func (m *Manager) GetBasePath() string
- func (m *Manager) GetCurrentDeployment() (*DeploymentState, error)
- func (m *Manager) GetDeploymentHistory(limit int) ([]*DeploymentState, error)
- func (m *Manager) GetLastStableDeployment() (*DeploymentState, error)
- func (m *Manager) GetServiceState(serviceName string) (*ServiceState, error)
- func (m *Manager) LogDeployment(message string) error
- func (m *Manager) LogError(err error) error
- func (m *Manager) SaveBuildCache(serviceName string, files map[string]string) error
- func (m *Manager) SaveDeployment(deployment *DeploymentState) error
- func (m *Manager) SaveServiceState(serviceName string, state *ServiceState) error
- type NetworkInfo
- type Resources
- type ServiceCurrent
- type ServiceDeploy
- type ServiceHistory
- type ServiceState
- type VolumeInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigInfo ¶
ConfigInfo represents configuration metadata
type ContainerInfo ¶
type ContainerInfo struct {
ID string `json:"id"`
Node string `json:"node,omitempty"`
Status string `json:"status"`
StartedAt time.Time `json:"started_at"`
}
ContainerInfo represents a container instance
type DeploymentState ¶
type DeploymentState struct {
DeploymentID string `json:"deployment_id"`
Timestamp time.Time `json:"timestamp"`
Environment string `json:"environment"`
Mode string `json:"mode"`
Status string `json:"status"` // success, failed, partial
DurationSeconds int `json:"duration_seconds"`
Services map[string]*ServiceDeploy `json:"services"`
Network *NetworkInfo `json:"network"`
Volumes []VolumeInfo `json:"volumes"`
Config ConfigInfo `json:"config"`
RollbackPoint bool `json:"rollback_point"`
Notes string `json:"notes"`
GitCommit string `json:"git_commit,omitempty"`
TriggeredBy string `json:"triggered_by,omitempty"`
}
DeploymentState represents a single deployment
type EnvironmentState ¶
type EnvironmentState struct {
Active bool `json:"active"`
Servers []string `json:"servers"`
LastDeployment time.Time `json:"last_deployment"`
DeploymentID string `json:"deployment_id"`
}
EnvironmentState represents state for a specific environment
type GlobalState ¶
type GlobalState struct {
Version string `json:"version"`
Project struct {
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
LastDeployed time.Time `json:"last_deployed"`
} `json:"project"`
Mode string `json:"mode"` // "swarm" or "single"
Environments map[string]*EnvironmentState `json:"environments"`
Metadata struct {
TakoVersion string `json:"tako_version"`
ConfigHash string `json:"config_hash"`
} `json:"metadata"`
}
GlobalState represents the overall project state
type HealthCheck ¶
type HealthCheck struct {
Endpoint string `json:"endpoint"`
LastCheck time.Time `json:"last_check"`
Status string `json:"status"`
ResponseTimeMs int `json:"response_time_ms"`
}
HealthCheck represents health check information
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles local state persistence in .tako directory
func NewManager ¶
NewManager creates a new state manager
func (*Manager) CheckBuildCache ¶
CheckBuildCache checks if rebuild is needed based on file checksums
func (*Manager) GetBasePath ¶
GetBasePath returns the base .tako directory path
func (*Manager) GetCurrentDeployment ¶
func (m *Manager) GetCurrentDeployment() (*DeploymentState, error)
GetCurrentDeployment returns the current deployment state
func (*Manager) GetDeploymentHistory ¶
func (m *Manager) GetDeploymentHistory(limit int) ([]*DeploymentState, error)
GetDeploymentHistory returns deployment history
func (*Manager) GetLastStableDeployment ¶
func (m *Manager) GetLastStableDeployment() (*DeploymentState, error)
GetLastStableDeployment returns the last stable deployment for rollback
func (*Manager) GetServiceState ¶
func (m *Manager) GetServiceState(serviceName string) (*ServiceState, error)
GetServiceState retrieves service state
func (*Manager) LogDeployment ¶
LogDeployment logs deployment messages
func (*Manager) SaveBuildCache ¶
SaveBuildCache saves build cache information
func (*Manager) SaveDeployment ¶
func (m *Manager) SaveDeployment(deployment *DeploymentState) error
SaveDeployment saves deployment state
func (*Manager) SaveServiceState ¶
func (m *Manager) SaveServiceState(serviceName string, state *ServiceState) error
SaveServiceState saves service-specific state
type NetworkInfo ¶
type NetworkInfo struct {
Name string `json:"name"`
Driver string `json:"driver"`
ID string `json:"id"`
}
NetworkInfo represents network configuration
type Resources ¶
type Resources struct {
CPULimit string `json:"cpu_limit"`
MemoryLimit string `json:"memory_limit"`
CurrentCPU string `json:"current_cpu"`
CurrentMemory string `json:"current_memory"`
}
Resources represents resource usage
type ServiceCurrent ¶
type ServiceCurrent struct {
Version string `json:"version"`
Image string `json:"image"`
DeployedAt time.Time `json:"deployed_at"`
Replicas int `json:"replicas"`
Status string `json:"status"`
}
ServiceCurrent represents current service state
type ServiceDeploy ¶
type ServiceDeploy struct {
Image string `json:"image"`
ImageID string `json:"image_id"`
Replicas int `json:"replicas"`
Ports []int `json:"ports"`
Domains []string `json:"domains"`
Health string `json:"health"`
Containers []ContainerInfo `json:"containers"`
BuildTime int `json:"build_time_seconds,omitempty"`
}
ServiceDeploy represents a service in a deployment
type ServiceHistory ¶
type ServiceHistory struct {
Version string `json:"version"`
DeployedAt time.Time `json:"deployed_at"`
RetiredAt time.Time `json:"retired_at"`
Reason string `json:"reason"`
}
ServiceHistory represents historical service deployments
type ServiceState ¶
type ServiceState struct {
Name string `json:"name"`
Current ServiceCurrent `json:"current"`
History []ServiceHistory `json:"history"`
HealthChecks HealthCheck `json:"health_checks"`
Resources Resources `json:"resources"`
}
ServiceState represents the current state of a service
type VolumeInfo ¶
type VolumeInfo struct {
Name string `json:"name"`
Driver string `json:"driver"`
MountPoint string `json:"mount_point"`
}
VolumeInfo represents volume configuration