Documentation
¶
Index ¶
- Constants
- Variables
- func PersistToServers(pool *ssh.Pool, cfg *config.Config, environment string, serverNames []string, ...) error
- type ActualNodeSnapshot
- type ActualService
- type ActualSnapshot
- func BuildActualSnapshot(project string, environment string, targetNodes []string, ...) *ActualSnapshot
- func BuildActualSnapshotWithNodes(project string, environment string, targetNodes []string, ...) *ActualSnapshot
- func BuildNodeActualSnapshot(project string, environment string, node string, ...) *ActualSnapshot
- type DesiredRevision
- type DesiredService
- type Event
- type GitInfo
- type Manager
- func (m *Manager) AppendEvent(event Event) error
- func (m *Manager) ReadActual() (*ActualSnapshot, error)
- func (m *Manager) ReadDesired() (*DesiredRevision, error)
- func (m *Manager) ReadNodeActual(node string) (*ActualSnapshot, error)
- func (m *Manager) WriteActual(snapshot *ActualSnapshot) error
- func (m *Manager) WriteDesired(revision *DesiredRevision) error
- func (m *Manager) WriteNodeActual(node string, snapshot *ActualSnapshot) error
Constants ¶
View Source
const (
SchemaVersion = 1
)
Variables ¶
View Source
var ErrNotFound = errors.New("takod state not found")
Functions ¶
func PersistToServers ¶
func PersistToServers(pool *ssh.Pool, cfg *config.Config, environment string, serverNames []string, desired *DesiredRevision, actual *ActualSnapshot, nodeActual map[string]*ActualSnapshot, event Event, verbose bool) error
Types ¶
type ActualNodeSnapshot ¶
type ActualNodeSnapshot struct {
Node string `json:"node"`
Services map[string]ActualService `json:"services"`
CapturedAt time.Time `json:"capturedAt"`
}
type ActualService ¶
type ActualSnapshot ¶
type ActualSnapshot struct {
SchemaVersion int `json:"schemaVersion"`
Project string `json:"project"`
Environment string `json:"environment"`
Node string `json:"node,omitempty"`
TargetNodes []string `json:"targetNodes,omitempty"`
Services map[string]ActualService `json:"services"`
Nodes map[string]ActualNodeSnapshot `json:"nodes,omitempty"`
CapturedAt time.Time `json:"capturedAt"`
}
func BuildActualSnapshot ¶
func BuildActualSnapshot(project string, environment string, targetNodes []string, actual map[string]*reconcile.ActualService) *ActualSnapshot
func BuildActualSnapshotWithNodes ¶
func BuildActualSnapshotWithNodes(project string, environment string, targetNodes []string, actual map[string]*reconcile.ActualService, nodeActual map[string]map[string]*reconcile.ActualService) *ActualSnapshot
func BuildNodeActualSnapshot ¶
func BuildNodeActualSnapshot(project string, environment string, node string, actual map[string]*reconcile.ActualService) *ActualSnapshot
type DesiredRevision ¶
type DesiredRevision struct {
SchemaVersion int `json:"schemaVersion"`
RevisionID string `json:"revisionId"`
Project string `json:"project"`
Environment string `json:"environment"`
Source string `json:"source"`
TargetNodes []string `json:"targetNodes"`
Services map[string]DesiredService `json:"services"`
Git GitInfo `json:"git,omitempty"`
CreatedAt time.Time `json:"createdAt"`
}
func BuildDesiredRevision ¶
type DesiredService ¶
type DesiredService struct {
Name string `json:"name"`
Type string `json:"type"`
Image string `json:"image,omitempty"`
Build string `json:"build,omitempty"`
Command string `json:"command,omitempty"`
Port int `json:"port,omitempty"`
Replicas int `json:"replicas"`
Restart string `json:"restart,omitempty"`
Persistent bool `json:"persistent,omitempty"`
Placement *config.PlacementConfig `json:"placement,omitempty"`
Domains []string `json:"domains,omitempty"`
Volumes []string `json:"volumes,omitempty"`
EnvKeys []string `json:"envKeys,omitempty"`
EnvFile bool `json:"envFile,omitempty"`
SecretRefs []string `json:"secretRefs,omitempty"`
DependsOn []string `json:"dependsOn,omitempty"`
HealthCheck config.HealthCheckConfig `json:"healthCheck,omitempty"`
DeployStrategy string `json:"deployStrategy,omitempty"`
}
type Event ¶
type Event struct {
SchemaVersion int `json:"schemaVersion"`
Type string `json:"type"`
Project string `json:"project"`
Environment string `json:"environment"`
RevisionID string `json:"revisionId,omitempty"`
Service string `json:"service,omitempty"`
Message string `json:"message,omitempty"`
Details map[string]string `json:"details,omitempty"`
Time time.Time `json:"time"`
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) AppendEvent ¶
func (*Manager) ReadActual ¶
func (m *Manager) ReadActual() (*ActualSnapshot, error)
func (*Manager) ReadDesired ¶
func (m *Manager) ReadDesired() (*DesiredRevision, error)
func (*Manager) ReadNodeActual ¶
func (m *Manager) ReadNodeActual(node string) (*ActualSnapshot, error)
func (*Manager) WriteActual ¶
func (m *Manager) WriteActual(snapshot *ActualSnapshot) error
func (*Manager) WriteDesired ¶
func (m *Manager) WriteDesired(revision *DesiredRevision) error
func (*Manager) WriteNodeActual ¶
func (m *Manager) WriteNodeActual(node string, snapshot *ActualSnapshot) error
Click to show internal directories.
Click to hide internal directories.