cleaner

package
v0.0.0-...-ab8dd2a Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: MIT Imports: 9 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

Index

Constants

View Source
const (
	TypeIssue            = "Issue"
	TypePullRequest      = "PullRequest"
	DefaultDaysThreshold = 30
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cleaner

type Cleaner interface {
	Clean(ctx context.Context) error
}

Cleaner defines the interface for cleaning notifications.

type NotificationsCleaner

type NotificationsCleaner struct {
	GitHubClient  *github.Client
	OlderThanDays int
	DryRun        bool
}

NotificationsCleaner defines the cleaner struct.

func NewNotificationsCleaner

func NewNotificationsCleaner(opts ...Option) *NotificationsCleaner

NewNotificationsCleaner creates a new NotificationsCleaner instance with the provided options. It initializes with a default GitHubClient.

func (*NotificationsCleaner) Clean

func (nc *NotificationsCleaner) Clean(ctx context.Context) error

Clean performs cleaning notifications. It marks notifications as done if they are related to closed pull requests/issues or if they are older than the configured number of days.

type Option

type Option func(*NotificationsCleaner)

Option defines a functional option for NotificationsCleaner.

func WithDryRun

func WithDryRun(dryRun bool) Option

WithDryRun is an option to enable dry-run mode.

func WithGitHubClient

func WithGitHubClient(client *github.Client) Option

WithGitHubClient is an option to set a custom GitHub client.

func WithOlderThanDays

func WithOlderThanDays(days int) Option

WithOlderThanDays is an option to set the age threshold (in days) for cleaning notifications.

Jump to

Keyboard shortcuts

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