cmd

package
v0.0.9 Latest Latest
Warning

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

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

Documentation

Overview

Package cmd wires the dev-dashboard CLI.

Index

Constants

View Source
const (
	SourceAuto   = "auto"
	SourceManual = "manual"
)

Source values for a ConnEntry.

Variables

This section is empty.

Functions

func Execute

func Execute() error

Execute runs the CLI.

func NewRootCmd

func NewRootCmd() *cobra.Command

NewRootCmd builds the root command (default action = serve).

Types

type ConnEntry

type ConnEntry struct {
	ID        string            `json:"id"`
	Name      string            `json:"name"`
	Type      string            `json:"type"`
	Source    string            `json:"source"`
	Path      string            `json:"path,omitempty"`
	Metadata  map[string]string `json:"metadata,omitempty"`
	UpdatedAt time.Time         `json:"updatedAt,omitempty"`
	Dismissed bool              `json:"dismissed,omitempty"`
}

ConnEntry is one persisted connection in the registry file. ID is a stable, deterministic, URL-safe key; the registry, API, ServiceFor, and CRUD address entries by ID (two distinct entries may share a Name). auto entries carry a Path (re-read + 2a-resolved on connect, no secrets in the file); manual entries carry inline Metadata (possibly secrets).

type ConnRegistry

type ConnRegistry struct {
	// contains filtered or unexported fields
}

ConnRegistry owns the user-profile connections.yaml file. All mutators persist under a mutex; List returns a copy.

func LoadRegistry

func LoadRegistry(homeDir string) *ConnRegistry

LoadRegistry reads the registry file. A missing or malformed file yields an empty (but usable) registry; it never returns nil and never crashes.

func (*ConnRegistry) Add

func (r *ConnRegistry) Add(e ConnEntry) error

Add inserts a manual entry keyed by name; errors if a manual entry with that name already exists.

func (*ConnRegistry) Delete

func (r *ConnRegistry) Delete(id string) error

Delete removes a manual entry by ID. An auto entry is kept but marked dismissed — a durable tombstone: UpsertAuto preserves the flag so discovery never resurrects it; only Undismiss (the store being elected active again) brings it back. An absent id is a no-op.

func (*ConnRegistry) List

func (r *ConnRegistry) List() []ConnEntry

List returns a copy of the current entries in stable order.

func (*ConnRegistry) Undismiss

func (r *ConnRegistry) Undismiss(path string) error

Undismiss clears the tombstone on the auto entry matching path (used when that store is elected active again: running apps are using it, so it must reappear). Clearing counts as activity, so updatedAt is bumped. A path with no dismissed entry is a no-op.

func (*ConnRegistry) Update

func (r *ConnRegistry) Update(e ConnEntry) (string, error)

Update replaces a manual entry matched by ID; errors if none exists. The id is recomputed from the (possibly new) name so it stays deterministic, and the new id is returned so callers can re-address the renamed entry. Renaming onto another manual entry's name errors (ids are keyed by name, so allowing it would produce two entries with the same id); renaming an entry to its own current name is fine.

func (*ConnRegistry) UpsertAuto

func (r *ConnRegistry) UpsertAuto(e ConnEntry) error

UpsertAuto inserts or refreshes an auto entry keyed by normalized path. It never overwrites a manual entry sharing the same normalized path.

type Mode added in v0.0.9

type Mode string

Mode selects the dashboard's discovery and serving posture. ModeDefault (the zero value, mode unset) is the complete scan across all discovery sources with today's host behavior; ModeAspire restricts discovery to the DEVDASHBOARD_APP_* env contract and switches to container posture. "dapr" and "compose" are reserved for future single-source filter modes.

const (
	ModeDefault Mode = ""
	ModeAspire  Mode = "aspire"
)

Jump to

Keyboard shortcuts

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