Documentation
¶
Index ¶
- Constants
- func WriteCacheKeyManifest(path string, manifest *api.CacheKeyManifest) error
- type CacheKeyManifestError
- type Engine
- func (e *Engine) CacheKey(ctx context.Context, req Request) (*api.CacheKeyResult, error)
- func (e *Engine) CacheKeyWithManifest(ctx context.Context, req Request) (*api.CacheKeyResult, *api.CacheKeyManifest, error)
- func (e *Engine) Graph() *graph.Graph
- func (e *Engine) Run(ctx context.Context, req Request) (*Outcome, error)
- func (e *Engine) SubscribeEvents() <-chan api.Event
- func (e *Engine) SubscribeEventsLossless() <-chan api.Event
- func (e *Engine) Watch(ctx context.Context, req Request) error
- type LifecycleController
- type Outcome
- type Request
- type ServiceIdentity
- type ServiceLifecycleResult
Constants ¶
const ( CacheKeyManifestSchemaVersion = 1 CacheKeyManifestMaxAge = 15 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
func WriteCacheKeyManifest ¶
func WriteCacheKeyManifest(path string, manifest *api.CacheKeyManifest) error
WriteCacheKeyManifest atomically writes a manifest with owner-only permissions. The manifest is intended for an immediate Run request using CacheKeyManifestPath, not for durable or cross-job cache storage.
Types ¶
type CacheKeyManifestError ¶
func (*CacheKeyManifestError) Error ¶
func (e *CacheKeyManifestError) Error() string
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) CacheKeyWithManifest ¶
func (e *Engine) CacheKeyWithManifest(ctx context.Context, req Request) (*api.CacheKeyResult, *api.CacheKeyManifest, error)
func (*Engine) SubscribeEvents ¶
func (*Engine) SubscribeEventsLossless ¶
SubscribeEventsLossless returns a backpressured event subscription for consumers that must observe every event, such as direct CI progress output.
type LifecycleController ¶
type LifecycleController struct {
// contains filtered or unexported fields
}
LifecycleController serializes external stop and restart requests with the engine loop that owns the service handles. Calling handle.Stop from the daemon directly would make the engine interpret the expected exit as a crash and stop unrelated services.
func NewLifecycleController ¶
func NewLifecycleController() *LifecycleController
func (*LifecycleController) Restart ¶
func (c *LifecycleController) Restart(ctx context.Context, task string) (ServiceLifecycleResult, error)
func (*LifecycleController) Stop ¶
func (c *LifecycleController) Stop(ctx context.Context, task string) (ServiceLifecycleResult, error)
type ServiceIdentity ¶
type ServiceIdentity struct {
PID int `json:"pid,omitempty"`
Generation uint64 `json:"generation"`
}
ServiceIdentity identifies one concrete service process. Generation remains useful for non-process ServiceHandle implementations whose PID is zero, and prevents a late Wait result from an old handle from being attributed to its replacement.
type ServiceLifecycleResult ¶
type ServiceLifecycleResult struct {
Task string `json:"task"`
Action string `json:"action"`
Previous ServiceIdentity `json:"previous"`
Current ServiceIdentity `json:"current"`
Stopped bool `json:"stopped"`
Ready bool `json:"ready"`
}
ServiceLifecycleResult describes the service process actually affected by a daemon lifecycle request.