Help us shape the future of Go! Take the 2026 Go Developer Survey

lfsgc

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package lfsgc plans LFS metadata garbage collection without moving object paths.

Index

Constants

View Source
const (
	// MinAge is the shortest retention that still leaves a window for a push to
	// upload an LFS object before its git pointer lands.
	MinAge = 24 * time.Hour
	// DefaultAge matches the existing doctor check: a week is long enough that an
	// unreferenced object is not an in-flight upload.
	DefaultAge = 7 * 24 * time.Hour
)

Variables

This section is empty.

Functions

func ParseRepository

func ParseRepository(spec string) (string, string, error)

ParseRepository accepts an empty spec or owner/name. It does not look up the database.

Types

type RepoResult

type RepoResult struct {
	Repository string `json:"repository"`
	Total      int64  `json:"total"`
	Orphaned   int    `json:"orphaned"`
	Collected  int    `json:"collected"`
	Deleted    int    `json:"deleted"`
	Stopped    bool   `json:"stopped,omitempty"`
}

RepoResult is one repository after a scan.

type Report

type Report struct {
	Apply        bool         `json:"apply"`
	DryRun       bool         `json:"dry_run"`
	OlderThan    string       `json:"older_than"`
	Repository   string       `json:"repository,omitempty"`
	Repositories []RepoResult `json:"repositories"`
	Orphaned     int          `json:"orphaned"`
	Deleted      int          `json:"deleted"`
}

Report is the machine-readable result of a dry-run or an apply.

func NewReport

func NewReport(req Request) Report

NewReport starts an empty JSON report. Repositories is an empty slice so agents do not see null.

func (*Report) Add

func (r *Report) Add(row RepoResult)

Add folds one repository into the totals.

type Request

type Request struct {
	Apply      bool
	OlderThan  time.Time
	Repository string
	Force      bool
	Now        time.Time
}

Request is the operator input shared by the CLI, admin page, and API.

func Normalize

func Normalize(req Request) (Request, error)

Normalize checks retention and the optional owner/name limit.

Jump to

Keyboard shortcuts

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