tui

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 7 Imported by: 0

README

internal/client/tui

Thin API adapter commands used by internal/tui to fetch list data and counters.

  • jobs.go — lists jobs and maps response rows to TUI-friendly items.
  • jobs_test.go — tests for jobs listing command behavior and decoding.
  • mig_totals.go — migration-level counters (repos/runs).
  • mig_totals_test.go — tests for migration totals commands.
  • migs.go — lists migrations for the TUI.
  • migs_test.go — tests for migrations listing command.
  • run_totals.go — run-level aggregate counters for detail panels.
  • run_totals_test.go — tests for run totals command behavior.
  • runs.go — lists runs for the TUI.
  • runs_test.go — tests for runs listing command behavior.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CountMigReposCommand

type CountMigReposCommand struct {
	Client  *http.Client
	BaseURL *url.URL
	MigID   domaintypes.MigID
}

CountMigReposCommand counts the repos in a migration's repo set.

func (CountMigReposCommand) Run

Run executes GET /v1/migs/{mig_id}/repos and returns the total repo count.

type CountMigRunsCommand

type CountMigRunsCommand struct {
	Client  *http.Client
	BaseURL *url.URL
	MigID   domaintypes.MigID
}

CountMigRunsCommand counts runs belonging to a specific migration by scanning the runs list.

func (CountMigRunsCommand) Run

Run fetches runs pages and counts those whose MigID matches the configured migration.

type GetRunTotalsCommand

type GetRunTotalsCommand struct {
	Client  *http.Client
	BaseURL *url.URL
	RunID   domaintypes.RunID
}

GetRunTotalsCommand fetches repo and job totals for a specific run. It calls GET /v1/runs/{id} for repo counts and GET /v1/jobs?run_id={id} for job total.

func (GetRunTotalsCommand) Run

Run fetches the run summary and job count for the configured run.

type JobItem

type JobItem struct {
	JobID      domaintypes.JobID     `json:"job_id"`
	Name       string                `json:"name"`
	Status     domaintypes.JobStatus `json:"status"`
	DurationMs int64                 `json:"duration_ms"`
	JobImage   string                `json:"job_image"`
	NodeID     *domaintypes.NodeID   `json:"node_id"`
	MigName    string                `json:"mig_name"`
	RunID      domaintypes.RunID     `json:"run_id"`
	RepoID     domaintypes.RepoID    `json:"repo_id"`
}

JobItem represents a single job entry from the list API.

type ListJobsCommand

type ListJobsCommand struct {
	Client  *http.Client
	BaseURL *url.URL
	Limit   int32
	Offset  int32
	RunID   *domaintypes.RunID // Optional: filter jobs to a specific run.
}

ListJobsCommand fetches a paginated list of jobs with an optional run_id filter.

func (ListJobsCommand) Run

Run executes GET /v1/jobs.

type ListJobsResult

type ListJobsResult struct {
	Jobs  []JobItem `json:"jobs"`
	Total int64     `json:"total"`
}

ListJobsResult is the response from GET /v1/jobs.

type ListMigsCommand

type ListMigsCommand struct {
	Client  *http.Client
	BaseURL *url.URL
	Limit   int32
	Offset  int32
}

ListMigsCommand fetches a paginated list of migrations.

func (ListMigsCommand) Run

Run executes GET /v1/migs.

type ListRunsCommand

type ListRunsCommand struct {
	Client  *http.Client
	BaseURL *url.URL
	Limit   int32
	Offset  int32
}

ListRunsCommand fetches a paginated list of runs.

func (ListRunsCommand) Run

Run executes GET /v1/runs.

type ListRunsResult

type ListRunsResult struct {
	Runs []domaintypes.RunSummary `json:"runs"`
}

ListRunsResult is the response from GET /v1/runs.

type RunTotals

type RunTotals struct {
	RepoTotal int32
	JobTotal  int64
}

RunTotals holds aggregated repo and job counts for a run.

Jump to

Keyboard shortcuts

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