progress

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package progress provides CI-safe progress logging for crawler jobs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Completion

func Completion(done, total int64) string

func Percent

func Percent(done, total int64) string

Types

type Options

type Options struct {
	Name     string
	Unit     string
	Total    int64
	LogEvery time.Duration
	MinDelta int64
	Attrs    []any
	Now      func() time.Time
}

type Tracker

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

func New

func New(logger *slog.Logger, opts Options) *Tracker

func (*Tracker) Add

func (t *Tracker) Add(delta int64, attrs ...any)

func (*Tracker) Finish

func (t *Tracker) Finish(err error, attrs ...any)

func (*Tracker) Set

func (t *Tracker) Set(done int64, attrs ...any)

Jump to

Keyboard shortcuts

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