gc

package
v7.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package gc provides a module for removing files and directories that have expired.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GarbageCollector

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

GarbageCollector is a module for removing files and directories that have expired. It allows us to make sure that the application does not leak files or directories when running.

func (GarbageCollector) Descriptor

Descriptor returns a GarbageCollector's module descriptor.

func (*GarbageCollector) Provision

func (gc *GarbageCollector) Provision(ctx *gotenberg.Context) error

Provision sets the module properties.

func (*GarbageCollector) Start

func (gc *GarbageCollector) Start() error

Start starts the garbage collector.

func (GarbageCollector) StartupMessage

func (gc GarbageCollector) StartupMessage() string

StartupMessage returns an empty string.

func (*GarbageCollector) Stop

func (gc *GarbageCollector) Stop(ctx context.Context) error

Stop stops the garbage collector.

type GarbageCollectorExcludeSubstrModifier

type GarbageCollectorExcludeSubstrModifier interface {
	ExcludeSubstr() []string
}

GarbageCollectorExcludeSubstrModifier is a module interface which adds the given substrings to the exclude list of the garbage collector. If a path contains one of those substrings, the garbage collector ignores it.

type GarbageCollectorGraceDurationModifier

type GarbageCollectorGraceDurationModifier interface {
	GraceDuration() time.Duration
}

GarbageCollectorGraceDurationModifier is a module interface which allows to update the expiration time of files and directories parsed by the garbage collector. For instance, if the grace duration is 30s, the garbage collector will remove paths that have a modification time older than 30s. If there are many GarbageCollectorGraceDurationModifier, only the longest grace duration is selected.

Jump to

Keyboard shortcuts

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