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

filememo

package
v0.1.1539 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package filememo keeps what was parsed from a file until the file changes, so a page that asks many times over reads it once.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Forget added in v0.1.908

func Forget()

Forget has every file looked at again on its next read: magpie wrote one.

func Gen added in v0.1.1291

func Gen() uint64

Gen is moved on by every Forget: what is built from files read here, and kept past one read, is built again when it moved.

func Hold added in v0.1.908

func Hold() (release func())

Hold has a file found unchanged not looked at again, for a request that only reads, until release is called or a second has gone by: the GUI's state looked at each agent's files hundreds of times over, a few thousand looks at the disk that a slow one (a Mac's antivirus looking at each) made seconds. A write meanwhile (Forget) has them looked at.

func Look added in v0.1.1201

func Look(path string)

Look has the file at path looked at on its next read, even while a request holds what was read (Hold): another magpie may have written it, which Forget, moved on by this one's writes alone, can't know of.

func Read

func Read[T any](kind, path string, parse func([]byte) (T, error)) (T, error)

Read is parse of the file at path, from what it gave last time when the file has the same size and time as then (and, written just now, the same bytes). kind tells apart two parses of one file. What it returns is shared: the caller must not change it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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