prune

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package prune finds sessions that are over, marks them ended, and says which hold queue items. It never touches a session that is alive or too new to judge, and it never deletes a queue.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	ID    state.ID
	Dir   textsafe.Text // the last part of its working directory, for the user
	Mark  bool          // it has not been marked ended yet
	Items int           // queue items it still holds
}

Action is one session that is over.

type NoRegistryError

type NoRegistryError struct{ Dir string }

NoRegistryError says the registry could not be read, so nothing can be judged.

func (*NoRegistryError) Error

func (e *NoRegistryError) Error() string

type Pruner

type Pruner struct {
	Store     state.Store
	ConfigDir string
	Reg       live.Registry
}

Pruner works on a state folder and the live-session registry.

func (Pruner) MarkEnded

func (p Pruner) MarkEnded(id state.ID) error

MarkEnded records that a session is over.

func (Pruner) Plan

func (p Pruner) Plan(ctx context.Context, now int64) ([]Action, error)

Plan lists the sessions that are over, at time now (seconds since the epoch).

Jump to

Keyboard shortcuts

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