changed

package
v0.0.242 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 1 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package changed detects session activity by comparing resting snapshots.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Changed

func Changed(before, after []byte) bool

Changed reports whether after differs from before.

func Equal

func Equal(a, b []byte) bool

Equal reports whether a and b are identical byte-for-byte (newlines count).

Types

type Tracker

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

Tracker remembers the last resting snapshot. The first Note is a baseline only (not a change).

func (*Tracker) Note

func (t *Tracker) Note(now string) (changed bool)

Note records now. Returns whether the session changed since the last Note. First call always returns false and stores the baseline.

func (*Tracker) Reset

func (t *Tracker) Reset()

Reset clears the baseline so the next Note baselines again.

func (*Tracker) Set

func (t *Tracker) Set(now string)

Set stores now as the resting baseline without reporting a change. Used after an occupy probe so inject/DEL side effects are not treated as session activity on the next sample.

Jump to

Keyboard shortcuts

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