trash

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 5 Imported by: 1 module, 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 trash moves deleted applications aside for the preferences' trash_days, so a delete can be undone, then forgets them with their history. The reads never see them: they read applications, and the history through its application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Empty

func Empty(ctx context.Context, tx bun.IDB, now time.Time) error

Empty forgets for good the applications deleted before Since, with their history.

func Forget

func Forget(ctx context.Context, tx bun.IDB, picked *bun.SelectQuery) ([]string, error)

Forget deletes for good the applications of picked, a SELECT of their ids in the trash, with their history, and returns their ids.

func Restore

func Restore(ctx context.Context, tx bun.IDB, ids []string) ([]string, error)

Restore moves the applications of ids back from the trash, and returns the ids it found.

func Since

func Since(ctx context.Context, db bun.IDB, now time.Time) (time.Time, error)

Since is the oldest deletion still kept at now: before it, the trash is emptied.

func Throw

func Throw(ctx context.Context, tx bun.IDB, picked *bun.SelectQuery, now time.Time) ([]string, error)

Throw moves the applications of picked, a SELECT of their ids, to the trash, and returns their ids. Like Restore, Empty and Forget, it touches the account of ctx only.

Types

This section is empty.

Jump to

Keyboard shortcuts

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