{"modulePath":"github.com/agentshield-dev/agentshield","version":"v0.0.1-rc.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package progress\n\nPackage progress logs bounded status lines for long-running loops, such as workers and pipelines, so operators can see what each one is doing without per-iteration log spam.\n\nA [Reporter](#Reporter) collects counters between lines. [Reporter.Tick](#Reporter.Tick) logs at most one line per [Interval](#Interval) while the loop did work, and at most one per [IdleInterval](#IdleInterval) while every counter stayed zero. Lines go to slog's default logger at Info level.\n\n## Constants\n\n```go\nconst (\n\tInterval     = 15 * time.Second\n\tIdleInterval = time.Minute\n)\n```\nInterval and IdleInterval bound how often a loop logs a status line.\n\n## Types\n\n```go\ntype Reporter struct {\n\t// contains filtered or unexported fields\n}\n```\nReporter accumulates named counters for one loop and logs them periodically. It is safe for concurrent use.\n\n```go\nfunc New(message string, attrs ...any) *Reporter\n```\nNew returns a reporter whose lines carry message and attrs. The first line is due one [Interval](#Interval) after creation.\n\n```go\nfunc (reporter *Reporter) Add(name string, delta int64)\n```\nAdd increments a counter for the next line.\n\n```go\nfunc (reporter *Reporter) Tick(ctx context.Context, status func() []any) bool\n```\nTick logs the counters since the previous line, plus the attrs status returns, when a line is due, and then resets the counters. status is called only when a line is logged, so it may query state; it may be nil. Tick reports whether it logged.\n\n","path":"github.com/agentshield-dev/agentshield/pkg/progress","name":"progress","synopsis":"Package progress logs bounded status lines for long-running loops, such as workers and pipelines, so operators can see what each one is doing without per-iteration log spam.","isRedistributable":true}
