app

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package app provides the CtrlPlane root orchestrator that wires all subsystems together. It is separated from the root ctrlplane package to avoid import cycles, since domain packages embed ctrlplane.Entity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CtrlPlane

type CtrlPlane struct {

	// Services are the public subsystem interfaces.
	Datacenters    datacenter.Service
	Instances      instance.Service
	Workloads      workload.Service
	Deploys        deploy.Service
	Templates      template.Service
	Health         health.Service
	Metrics        metrics.Service
	ProviderHealth *providerhealth.Cache
	Telemetry      telemetry.Service
	Network        network.Service
	Secrets        secrets.Service
	Admin          admin.Service
	Bootstraps     bootstrap.Service
	// contains filtered or unexported fields
}

CtrlPlane is the root orchestrator that wires all subsystems together.

func New

func New(opts ...Option) (*CtrlPlane, error)

New creates a CtrlPlane with the given options.

func (*CtrlPlane) Auth

func (cp *CtrlPlane) Auth() auth.Provider

Auth returns the auth provider.

func (*CtrlPlane) Config

func (cp *CtrlPlane) Config() ctrlplane.Config

Config returns the current configuration.

func (*CtrlPlane) Events

func (cp *CtrlPlane) Events() event.Bus

Events returns the event bus.

func (*CtrlPlane) Extensions added in v0.0.3

func (cp *CtrlPlane) Extensions() *plugin.Registry

Extensions returns the plugin registry.

func (*CtrlPlane) Providers

func (cp *CtrlPlane) Providers() *provider.Registry

Providers returns the provider registry.

func (*CtrlPlane) Routes

func (cp *CtrlPlane) Routes() http.Handler

Routes returns an http.Handler with all ctrlplane API routes mounted. This is a stub that will be filled in when the api/ package is implemented.

func (*CtrlPlane) Scheduler added in v1.3.0

func (cp *CtrlPlane) Scheduler() *worker.Scheduler

Scheduler returns the background worker scheduler.

func (*CtrlPlane) SetAuditRecorder added in v1.5.1

func (cp *CtrlPlane) SetAuditRecorder(r audithook.Recorder)

SetAuditRecorder swaps the audit-trail backend used by the default audit_hook plugin. Pass a chronicle-backed adapter (or any audithook.Recorder) to redirect audit events from the in-store table to a richer system. No-op when audit_hook wasn't constructed (e.g. cp.extensions==nil during a stripped-down test build).

func (*CtrlPlane) SetVault added in v1.3.0

func (cp *CtrlPlane) SetVault(v secrets.Vault)

SetVault replaces the vault and propagates it to dependent services.

func (*CtrlPlane) Start

func (cp *CtrlPlane) Start(ctx context.Context) error

Start begins background workers (health checks, reconciliation, GC).

func (*CtrlPlane) Stop

func (cp *CtrlPlane) Stop(ctx context.Context) error

Stop gracefully shuts down workers and flushes state.

func (*CtrlPlane) Store

func (cp *CtrlPlane) Store() store.Store

Store returns the underlying store.

func (*CtrlPlane) Vault added in v1.3.0

func (cp *CtrlPlane) Vault() secrets.Vault

Vault returns the vault backend used for secret storage.

type Option

type Option func(*CtrlPlane) error

Option configures a CtrlPlane instance.

func WithAuth

func WithAuth(p auth.Provider) Option

WithAuth sets the authentication/authorization provider.

func WithBootstrapHook added in v1.5.1

func WithBootstrapHook(h bootstrap.Hook) Option

WithBootstrapHook registers a bootstrap.Hook with the control plane.

Hooks are the programmatic-contribution path for shared platform services that auto-deploy on every datacenter (declarative contributions live on Datacenter.BootstrapServices). The reconciler worker calls every registered hook on every datacenter on every tick — hooks self-filter by inspecting the supplied DatacenterInfo.

Re-registering a hook with the same Name replaces the previous entry, supporting hot-reload of an extension's hook definition.

func WithConfig

func WithConfig(cfg ctrlplane.Config) Option

WithConfig sets the configuration.

func WithDefaultProvider

func WithDefaultProvider(name string) Option

WithDefaultProvider sets the default provider name.

func WithEventBus

func WithEventBus(b event.Bus) Option

WithEventBus replaces the default in-memory event bus.

func WithExtension added in v0.0.3

func WithExtension(ext plugin.Extension) Option

WithExtension registers a plugin extension with the control plane.

func WithProvider

func WithProvider(name string, p provider.Provider) Option

WithProvider registers a named infrastructure provider.

func WithStore

func WithStore(s store.Store) Option

WithStore sets the persistence store.

func WithVault added in v1.3.0

func WithVault(v secrets.Vault) Option

WithVault sets the secret storage backend.

Jump to

Keyboard shortcuts

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