gc

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GC

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

GC represents a Garbage Collector configuration for database cleanup.

func NewGC

func NewGC(db *db.Postgres, opts ...Option) *GC

NewGC creates a new GC instance with the provided configuration.

func (*GC) Run

func (gc *GC) Run() error

Run performs the garbage collection process.

func (*GC) Start

func (gc *GC) Start(ctx context.Context) error

Start initiates the garbage collection process periodically.

type Option

type Option func(gc *GC)

Option represents a function that configures a GC (Garbage Collector) instance.

func Interval

func Interval(n time.Duration) Option

Interval is an option that sets the interval duration for the GC.

func Timeout

func Timeout(n time.Duration) Option

Timeout is an option that sets the timeout duration for the GC.

func Window

func Window(n time.Duration) Option

Window is an option that sets the window duration for the GC.

Jump to

Keyboard shortcuts

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