Documentation
¶
Index ¶
- type Manager
- func (m *Manager) Deploy(ctx context.Context, slug string, credentials map[string]string) (store.Deployment, error)
- func (m *Manager) HasNativeRuntime() bool
- func (m *Manager) List(ctx context.Context) ([]runtime.ContainerInfo, error)
- func (m *Manager) Logs(ctx context.Context, slug string, lines int) (string, error)
- func (m *Manager) PlanRemoval(ctx context.Context, slug string) (runtime.RemovalPlan, error)
- func (m *Manager) Refresh(ctx context.Context) ([]store.Deployment, error)
- func (m *Manager) Register(kind string, provider runtime.Provider)
- func (m *Manager) Remove(ctx context.Context, slug string, deleteData, allowCritical bool) error
- func (m *Manager) RequiredCredentialsMet(slug string, credentials map[string]string) bool
- func (m *Manager) Restart(ctx context.Context, slug string) error
- func (m *Manager) Start(ctx context.Context, slug string) error
- func (m *Manager) Stop(ctx context.Context, slug string) error
- func (m *Manager) ValidateCredentials(slug string, credentials map[string]string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager owns the runtime provider registry and reconciles it against the store. providers is keyed by runtime kind; defaultKind is the kind used when a deployment or service does not name one — which is every service today, since Docker is the only registered runtime.
func NewManager ¶
NewManager builds a Manager whose registry holds the given provider under defaultRuntimeKind, which also becomes the default kind. The signature is unchanged: callers still pass the single Docker provider, so the app stays single-runtime in behavior until a second provider is registered.
func (*Manager) HasNativeRuntime ¶ added in v0.10.0
HasNativeRuntime reports whether a provider is registered under the native runtime kind. Native execution has no external dependency (no daemon or socket to reach), so a registered native provider is by construction available — the app surfaces this alongside Docker's Status so onboarding can proceed on either signal. It reflects registration only; it never probes a running process.
func (*Manager) List ¶ added in v0.10.0
List returns every managed unit across all registered providers as a single flat slice — the monitoring/health view used by the app's health sampler. An error is returned only when no provider listed successfully; a partial failure yields the healthy providers' units (the failing provider's error is non-fatal). With just Docker registered this returns Docker's list unchanged, or Docker's error.
func (*Manager) PlanRemoval ¶ added in v0.17.8
PlanRemoval reports what removing a service would delete, so the confirmation the user is shown can name the data instead of saying "and its volumes".
func (*Manager) Register ¶ added in v0.10.0
Register adds a provider under the given runtime kind. It is the registration point the app uses to plug in additional runtimes (e.g. the native process runtime) after construction. Call it during Startup before the manager is shared with background reconciliation goroutines; it is not synchronized against a running Refresh.
func (*Manager) Remove ¶
Remove removes the service. deleteData decides whether the data it stored goes with it; allowCritical is the separate yes needed for the volumes whose loss cannot be undone. Both default to false, so the ordinary "remove this service" leaves every node identity and keystore on disk for a later redeploy to pick up.
func (*Manager) RequiredCredentialsMet ¶ added in v0.11.0
RequiredCredentialsMet reports whether every required field for the service is present in the given credentials. Unlike ValidateCredentials it does not reject a manually tracked service, so the settings "Configured" badge can reflect whether the stored blob actually satisfies the current schema — not merely that it is non-empty, which an orphaned pre-migration blob (wrong keys) would also be.
func (*Manager) ValidateCredentials ¶ added in v0.11.0
ValidateCredentials reports whether the given credentials would let the service deploy — mirroring Deploy's pre-checks (known, deployable, required fields present) — so a caller can validate BEFORE persisting anything.