Documentation
¶
Index ¶
- Variables
- type AuthConfig
- type Config
- type Cook
- func (c *Cook) Cleanup(keep int) error
- func (c *Cook) CollectMetrics() Metrics
- func (c *Cook) CurrentCommit() string
- func (c *Cook) CurrentPath() string
- func (c *Cook) ListDeployments() ([]Deployment, error)
- func (c *Cook) Make(ctx context.Context) error
- func (c *Cook) Rollback(commitHash string) error
- func (c *Cook) SetCurrentPath(path string)
- type Deployment
- type Entry
- type HealthStatus
- type Manager
- func (m *Manager) CurrentPath(routeKey string) string
- func (m *Manager) GetCook(routeKey string) (*Cook, bool)
- func (m *Manager) HandleWebhook(w http.ResponseWriter, r *http.Request, routeKey string)
- func (m *Manager) Health() map[string]HealthStatus
- func (m *Manager) Prune(activeIDs map[string]bool)
- func (m *Manager) Register(routeKey string, cfg alaye.Git) error
- func (m *Manager) Stop()
- func (m *Manager) Unregister(routeKey string)
- func (m *Manager) WebhookHandler(routeKey string) http.HandlerFunc
- type ManagerConfig
- type Metrics
- type WebhookPayload
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type AuthConfig struct {
Type string // "basic", "ssh-key", "ssh-agent"
Username string
Password string
SSHKey string
SSHKeyPassphrase string
}
AuthConfig defines authentication options for git operations.
type Config ¶
type Config struct {
ID string
URL string // empty for push-only mode
Branch string
WorkDir string
Logger *ll.Logger
Auth AuthConfig
Metrics *Metrics
KeepLast int
}
Config defines the configuration for a Cook instance.
type Cook ¶
type Cook struct {
// contains filtered or unexported fields
}
Cook handles atomic git-based deployments with zero downtime. In push-only mode (URL == ""), Cook does not clone — it serves content written directly to the work directory via webhook.
func New ¶
New creates a Cook instance. URL may be empty for push-only mode, in which case Make must never be called.
func (*Cook) CollectMetrics ¶
CollectMetrics returns a snapshot of current metrics (if configured).
func (*Cook) CurrentCommit ¶
CurrentCommit returns the commit hash of the active deployment. Returns empty string in push-only mode.
func (*Cook) CurrentPath ¶
CurrentPath returns the filesystem path currently being served. For pull/both mode this is the most recent deployment directory. For push-only mode this is the work directory set by SetCurrentPath.
func (*Cook) ListDeployments ¶
func (c *Cook) ListDeployments() ([]Deployment, error)
ListDeployments returns all available deployment commits sorted newest first.
func (*Cook) Make ¶
Make performs an atomic deployment from the configured repository. Must not be called in push-only mode (URL == "").
func (*Cook) SetCurrentPath ¶
SetCurrentPath sets the serving path directly without a deployment. Used exclusively by push-only mode so CurrentPath returns immediately rather than blocking on a clone that will never happen.
type Deployment ¶
Deployment represents a single deployed version.
type HealthStatus ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(cfg ManagerConfig) (*Manager, error)
func (*Manager) CurrentPath ¶
func (*Manager) HandleWebhook ¶
func (*Manager) Health ¶
func (m *Manager) Health() map[string]HealthStatus
func (*Manager) Unregister ¶
func (*Manager) WebhookHandler ¶
func (m *Manager) WebhookHandler(routeKey string) http.HandlerFunc