services

package
v0.21.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

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

func NewManager(provider runtime.Provider, cat *catalog.Catalog, st *store.Store) *Manager

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) Deploy

func (m *Manager) Deploy(ctx context.Context, slug string, credentials map[string]string) (store.Deployment, error)

func (*Manager) HasNativeRuntime added in v0.10.0

func (m *Manager) HasNativeRuntime() bool

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

func (m *Manager) List(ctx context.Context) ([]runtime.ContainerInfo, error)

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) Logs

func (m *Manager) Logs(ctx context.Context, slug string, lines int) (string, error)

func (*Manager) PlanRemoval added in v0.17.8

func (m *Manager) PlanRemoval(ctx context.Context, slug string) (runtime.RemovalPlan, error)

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) Refresh

func (m *Manager) Refresh(ctx context.Context) ([]store.Deployment, error)

func (*Manager) Register added in v0.10.0

func (m *Manager) Register(kind string, provider runtime.Provider)

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

func (m *Manager) Remove(ctx context.Context, slug string, deleteData, allowCritical bool) error

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

func (m *Manager) RequiredCredentialsMet(slug string, credentials map[string]string) bool

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) Restart

func (m *Manager) Restart(ctx context.Context, slug string) error

func (*Manager) Start added in v0.6.0

func (m *Manager) Start(ctx context.Context, slug string) error

func (*Manager) Stop

func (m *Manager) Stop(ctx context.Context, slug string) error

func (*Manager) ValidateCredentials added in v0.11.0

func (m *Manager) ValidateCredentials(slug string, credentials map[string]string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL