Documentation
¶
Overview ¶
Package toolout keeps the tool-out directory, where truncated answers are saved, from growing without bound: age limit, size cap, and a periodic sweep.
Index ¶
- Constants
- func Base() string
- func Dir(base string) string
- func OwnerPath(dump string) string
- func ParseSize(s string) (int64, error)
- func Run(ctx context.Context, base string, cfg Config, interval time.Duration, ...) <-chan struct{}
- func Usage(base string) (size int64, count int, oldest time.Time, err error)
- type Config
- type Report
Constants ¶
const ( // DefaultTTL is how long a saved answer stays readable. DefaultTTL = 24 * time.Hour // DefaultMax is the size cap of one tool-out directory. DefaultMax = int64(256 << 20) // Interval is how often a running process sweeps. Измеренный поток — около // 2 МиБ в час на один болтливый сервер, поэтому час давал перелёт потолка в // разы между чистками. Interval = 10 * time.Minute )
const AnonymousOwner = "anonymous"
AnonymousOwner marks a dump whose caller presented no key: an open set, or stdio. Such a dump is readable by a caller that has no key either.
Variables ¶
This section is empty.
Functions ¶
func OwnerPath ¶ added in v0.6.0
OwnerPath is the sidecar that keeps a dump to the key that asked for it: one line, the key fingerprint the counters use.
Types ¶
type Config ¶
Config is the retention policy for tool-out.
func ApplyTransport ¶ added in v0.9.0
ApplyTransport overrides TTL and Max from transport.toolOutTtl and transport.toolOutMax of the set's servers.json. A value that does not parse is reported back as a warning and the previous value is kept: the panel's environment does not reach its child, so the registry is the only way the policy gets there.