state

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package state provides centralized state management for the dashboard.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BenchmarkEntry

type BenchmarkEntry struct {
	Name       string
	Iterations int
	NsPerOp    float64
}

BenchmarkEntry represents a single benchmark line.

type BenchmarkResult

type BenchmarkResult struct {
	Status  Status
	Entries []BenchmarkEntry
	Output  string
	Err     string
}

BenchmarkResult holds benchmark information.

type BinaryResult

type BinaryResult struct {
	Status Status
	Size   int64 // bytes
	Err    string
}

BinaryResult holds binary size information.

type CoverageResult

type CoverageResult struct {
	Status     Status
	Percentage float64
	Output     string
	Err        string
}

CoverageResult holds coverage information.

type Dashboard

type Dashboard struct {
	ProjectDir  string
	ProjectName string
	Version     string
	Notice      string

	Tests      TestsResult
	Coverage   CoverageResult
	Lint       LintResult
	Benchmarks BenchmarkResult
	Binary     BinaryResult
	Deps       DepsResult
	Git        GitResult
}

Dashboard is the central state container for the entire application.

func New

func New(projectDir, projectName, version string) *Dashboard

New creates a new Dashboard state for the given project directory.

type DepsResult

type DepsResult struct {
	Status Status
	Deps   []string
	Err    string
}

DepsResult holds dependency information.

type GitResult

type GitResult struct {
	Status   Status
	Modified []string
	Added    []string
	Deleted  []string
	Other    []string
	Err      string
}

GitResult holds git status information.

type LintResult

type LintResult struct {
	Status Status
	Issues []string
	Err    string
}

LintResult holds linting information.

type Status

type Status int

Status represents the state of an operation.

const (
	StatusIdle    Status = iota // Not yet run
	StatusRunning               // Currently executing
	StatusDone                  // Completed successfully
	StatusError                 // Completed with error
)

func (Status) String

func (s Status) String() string

String returns a human-readable label for the status.

type TestsResult

type TestsResult struct {
	Status      Status
	Passed      bool
	TestCases   int
	FailedTests int
	Packages    int
	Duration    time.Duration
	Output      string
	Err         string
}

TestsResult holds the outcome of running go test.

Jump to

Keyboard shortcuts

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