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

usage

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package usage computes the storage summary (GET /api/storageinfo): blob totals, item totals per repository and for the trash can, and the capacity of the volume a local blob store lives on. It is computed on every request rather than cached, so it never lags writes.

Index

Constants

View Source
const DefaultProject = "default"

DefaultProject is the project key of a repository in no project.

View Source
const NoFilesystem = "Filesystem storage is not used"

NoFilesystem is the directory Artifactory reports for a binary provider chain with no file-system or cache-fs provider in it, as an object store is here: it keeps no local copy (6.20's StorageSummaryImpl).

Variables

This section is empty.

Functions

This section is empty.

Types

type Location

type Location struct {
	// Type names the store as Artifactory names a binary provider chain:
	// its template, such as file-system or s3-storage-v3-direct, or
	// user-chain for a chain no template describes.
	Type string
	// Directory is the root directory, NoFilesystem for an object store, or
	// the mirror's members.
	Directory string
	// Root is the local directory whose volume reports capacity; empty for
	// object storage, whose capacity is unknown.
	Root string
}

Location describes the hot blob store for the summary.

type Row

type Row struct {
	Key string
	// Type is LOCAL, CACHE, VIRTUAL or FEDERATED, or NA for the trash can.
	Type string
	// PackageType is empty for the trash can.
	PackageType repo.PackageType
	// ProjectKey is DefaultProject for a repository in no project and for
	// the trash can.
	ProjectKey string
	Files      int64
	Folders    int64
	Bytes      int64
}

Row is one repository's line, a remote repository's cache under its "<key>-cache" alias, or the trash can's.

type Space

type Space struct {
	Total, Free int64
}

Space is the capacity of a volume in bytes.

type Summary

type Summary struct {
	BinariesCount, BinariesSize int64
	// ArtifactsCount and ArtifactsSize count every file as stored before
	// deduplication, the trash can's included; ItemsCount adds the folders.
	ArtifactsCount, ArtifactsSize, ItemsCount int64
	Location                                  Location
	// Space is nil when the capacity is unknown.
	Space *Space
	// Rows are sorted by key, the trash can's among them.
	Rows []Row
}

Summary is the storage summary.

func Summarize

func Summarize(ctx context.Context, st store.Store, loc Location) (Summary, error)

Summarize computes the summary of st over the blob store at loc.

Jump to

Keyboard shortcuts

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