Help us shape the future of Go! Take the 2026 Go Developer Survey

changed

package
v0.0.204 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 1 Imported by: 0

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