controlplane

package
v0.0.17 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	RuntimeDocker = containerruntime.Docker
	RuntimePodman = containerruntime.Podman
	RuntimeNone   = containerruntime.None
)

Variables

View Source
var (
	ErrRuntimeUnavailable = errors.New("no container runtime available")
	ErrUnknownService     = errors.New("unknown control-plane service")
	ErrInvalidAction      = errors.New("invalid action")
)
View Source
var LiveServiceNames = []string{"dapr_scheduler", "dapr_placement"}

LiveServiceNames are the self-hosted control-plane containers this dashboard manages.

Functions

func IsLiveName

func IsLiveName(name string) bool

func ValidAction

func ValidAction(action string) bool

ValidAction reports whether action is one of the allowed lifecycle verbs.

Types

type ListResult

type ListResult struct {
	Runtime             RuntimeKind `json:"runtime"`
	Available           bool        `json:"available"`
	Reachable           bool        `json:"reachable"`           // runtime daemon responded
	ControlPlanePresent bool        `json:"controlPlanePresent"` // >=1 live container exists
	Services            []Service   `json:"services"`
}

ListResult is the payload of GET /api/controlplane.

type Manager

type Manager interface {
	List(ctx context.Context) (ListResult, error)
	Do(ctx context.Context, action, name string) error
	LogStream(ctx context.Context, name string) (<-chan string, error)
}

Manager lists and controls the local control-plane services.

func New

func New(src Sources) Manager

New resolves the container runtime from the environment and PATH.

type RuntimeKind

type RuntimeKind = containerruntime.Kind

RuntimeKind identifies the resolved container runtime.

type Service

type Service struct {
	Name           string        `json:"name"`
	Status         ServiceStatus `json:"status"`
	Healthy        bool          `json:"healthy"`
	Ports          []string      `json:"ports"`
	MemoryBytes    uint64        `json:"memoryBytes"`
	MemoryHuman    string        `json:"memoryHuman"`
	LogPath        string        `json:"logPath"`
	Actionable     bool          `json:"actionable"`
	ComposeProject string        `json:"composeProject,omitempty"`
}

Service is one control-plane service row returned by GET /api/controlplane.

type ServiceStatus

type ServiceStatus string

ServiceStatus is the coarse lifecycle state shown in the UI.

const (
	StatusRunning ServiceStatus = "running"
	StatusStopped ServiceStatus = "stopped"
	StatusUnknown ServiceStatus = "unknown"
)

type Sources added in v0.0.11

type Sources struct {
	Init    bool // fixed dapr_* containers created by `dapr init`
	Compose bool // compose-labeled placement/scheduler containers
}

Sources selects which control-plane families List reports and Do/LogStream accept. The zero value shows nothing — e.g. test-containers mode, which has no control-plane detection yet (deferred to a future iteration).

func AllSources added in v0.0.11

func AllSources() Sources

AllSources is the mode-unset default: every family.

Jump to

Keyboard shortcuts

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