Documentation
¶
Overview ¶
Package ledger is an append-only store of completed ushr jobs. The controller appends a record per workflow_job webhook; `ushr cost` reads them to total runner-minutes without re-scanning GitHub.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPath ¶
func DefaultPath() string
DefaultPath is where the ledger lives when config doesn't set webhook.ledger_path.
func PathOrDefault ¶
PathOrDefault resolves a configured ledger path, falling back to DefaultPath.
Types ¶
type Ledger ¶
type Ledger struct {
// contains filtered or unexported fields
}
Ledger appends records as JSON lines to a file. Append is safe for concurrent use; the file is the single source of truth, opened per write.
type Record ¶
type Record struct {
JobID int64 `json:"job_id"`
Org string `json:"org"`
Repo string `json:"repo"`
Workflow string `json:"workflow,omitempty"`
RunID int64 `json:"run_id,omitempty"`
Conclusion string `json:"conclusion,omitempty"`
Labels []string `json:"labels"`
RunnerName string `json:"runner_name"`
CreatedAt time.Time `json:"created_at,omitzero"`
StartedAt time.Time `json:"started_at"`
CompletedAt time.Time `json:"completed_at"`
}
Record is one completed job served by an ushr runner.
Click to show internal directories.
Click to hide internal directories.