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

awareness

package
v1.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidConfiguration = errors.New("invalid storage configuration")

Functions

This section is empty.

Types

type Admission

type Admission struct {
	Allowed        bool   `json:"allowed"`
	WriteProtected bool   `json:"write_protected"`
	Reason         string `json:"reason,omitempty"`
}

type AssetUsage

type AssetUsage struct {
	Extension string `json:"extension"`
	Bytes     int64  `json:"bytes"`
	Files     int64  `json:"files"`
	Strategy  string `json:"strategy"`
}

type Category

type Category string
const (
	CategoryDatabase    Category = "database"
	CategoryGitObjects  Category = "git_objects"
	CategoryLFSAssets   Category = "lfs_assets"
	CategoryArtifacts   Category = "artifacts"
	CategoryPackages    Category = "packages"
	CategoryBackups     Category = "backups"
	CategoryAttachments Category = "attachments"
	CategoryOther       Category = "other_volume_usage"
)

type CleanupAction

type CleanupAction struct {
	Kind        string   `json:"kind"`
	Priority    int      `json:"priority"`
	Category    Category `json:"category,omitempty"`
	ReviewBytes int64    `json:"review_bytes,omitempty"`
}

type CleanupPlan

type CleanupPlan struct {
	Status          string          `json:"status"`
	MeasuredAt      time.Time       `json:"measured_at"`
	TargetFreeBytes int64           `json:"target_free_bytes"`
	BytesToTarget   int64           `json:"bytes_to_target"`
	AutomaticDelete bool            `json:"automatic_delete"`
	Actions         []CleanupAction `json:"actions"`
}

type InventoryRoot

type InventoryRoot struct {
	Category Category
	Path     string
}

type LiveOptions

type LiveOptions struct {
	VolumePath     string
	ReserveBytes   int64
	InventoryRoots []InventoryRoot
	CacheTTL       time.Duration
	MaxEntries     int
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewLiveService

func NewLiveService(options LiveOptions) (*Service, error)

func NewService

func NewService(capacity int64, initialUsage []Usage) *Service

func (*Service) Admit

func (s *Service) Admit(writeBytes int64) Admission

func (*Service) CleanupPlan

func (s *Service) CleanupPlan() CleanupPlan

func (*Service) SetUsage

func (s *Service) SetUsage(category Category, bytes int64)

func (*Service) Snapshot

func (s *Service) Snapshot() Snapshot

type Snapshot

type Snapshot struct {
	Source             string       `json:"source"`
	VolumePath         string       `json:"volume_path,omitempty"`
	CapacityBytes      int64        `json:"capacity_bytes"`
	UsedBytes          int64        `json:"used_bytes"`
	AvailableBytes     int64        `json:"available_bytes"`
	ReservedBytes      int64        `json:"reserved_bytes"`
	WarningFreeBytes   int64        `json:"warning_free_bytes"`
	ProtectedFreeBytes int64        `json:"protected_free_bytes"`
	UsageRatio         float64      `json:"usage_ratio"`
	Warning            bool         `json:"warning"`
	WriteProtected     bool         `json:"write_protected"`
	MeasurementError   string       `json:"measurement_error,omitempty"`
	InventoryError     string       `json:"inventory_error,omitempty"`
	InventoryTruncated bool         `json:"inventory_truncated"`
	MeasuredAt         time.Time    `json:"measured_at"`
	Usage              []Usage      `json:"usage"`
	GameAssets         []AssetUsage `json:"game_assets"`
}

func (Snapshot) GitLFSBytes added in v1.6.0

func (s Snapshot) GitLFSBytes() int64

GitLFSBytes counts measured file bytes without including other applications on the volume.

type Usage

type Usage struct {
	Category Category `json:"category"`
	Bytes    int64    `json:"bytes"`
	Files    int64    `json:"files,omitempty"`
}

type VolumeStats

type VolumeStats struct {
	CapacityBytes  int64
	AvailableBytes int64
}

Jump to

Keyboard shortcuts

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