data

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorStyle

func ColorStyle(colorKey string, bullet string) string

ColorStyle returns the ANSI-colored bullet given a color key and a plain bullet symbol.

func FormatStatusLine

func FormatStatusLine(state string, statusText string) (string, string)

FormatStatusLine produces the "● <StatusText>" content and chooses a color key. Returns (bulletColor, text) where bulletColor is one of: success, warning, error.

Types

type ComposeClient

type ComposeClient interface {
	ComposeConfigFull(ctx context.Context, workingDir string, files []string, profiles []string, envFiles []string, inline []string) (dockercli.ComposeConfigDoc, error)
}

ComposeClient captures the docker compose operations required by the dashboard loader.

type Key

type Key struct {
	Stack   string
	Service string
}

Key uniquely identifies a service status entry in the dashboard list.

type Loader

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

Loader prepares dashboard-ready data derived from the manifest and compose files.

func NewLoader

func NewLoader(cfg *manifest.Config, docker ComposeClient) (*Loader, error)

NewLoader creates a new dashboard data loader. The docker client may be nil for tests.

func (*Loader) StackSummaries

func (l *Loader) StackSummaries(ctx context.Context) ([]StackSummary, error)

StackSummaries resolves compose metadata for each manifest stack.

type ServiceSummary

type ServiceSummary struct {
	Service       string
	ContainerName string
	Image         string
	Networks      []string
	Volumes       []string
}

ServiceSummary holds the compose service metadata displayed in the dashboard.

type StackSummary

type StackSummary struct {
	Name     string
	Services []ServiceSummary
}

StackSummary represents the information needed to populate the stacks column.

type Status

type Status struct {
	ContainerName string
	State         string // running, exited, restarting, created, etc.
	StatusText    string // e.g., "Up 13 days (healthy)" or "Exited (0) 2 hours ago"
}

type StatusProvider

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

StatusProvider resolves container names for services and fetches their docker ps status.

func NewStatusProvider

func NewStatusProvider(d *dockercli.Client, identifier string) *StatusProvider

func (*StatusProvider) Docker

func (sp *StatusProvider) Docker() *dockercli.Client

Docker exposes the underlying docker client; used by the TUI to stream logs.

func (*StatusProvider) FetchAll

func (sp *StatusProvider) FetchAll(ctx context.Context, stacks []StackSummary) (map[Key]Status, error)

FetchAll returns a map from (stack, service) to Status. Unknown entries are omitted.

func (*StatusProvider) ResolveContainerName

func (sp *StatusProvider) ResolveContainerName(ctx context.Context, stackName string, svc ServiceSummary) (string, error)

ResolveContainerName chooses the container name for a service. Prefer an explicit container name from compose; otherwise, a best-effort lookup by labels.

Jump to

Keyboard shortcuts

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