Documentation
¶
Index ¶
Constants ¶
const ( RuntimeDocker = containerruntime.Docker RuntimePodman = containerruntime.Podman RuntimeNone = containerruntime.None )
Variables ¶
var ( ErrUnknownService = errors.New("unknown control-plane service") ErrInvalidAction = errors.New("invalid action") )
var LiveServiceNames = []string{"dapr_scheduler", "dapr_placement"}
LiveServiceNames are the self-hosted control-plane containers this dashboard manages.
Functions ¶
func IsLiveName ¶
func ValidAction ¶
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.
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.