counter

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package counter reads and writes integer counters persisted in state files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(path string) int

Read reads an integer counter from a file. Returns 0 if the file does not exist or cannot be parsed.

Parameters:

  • path: Absolute path to the counter file

Returns:

  • int: Counter value, or 0 on error

func Write

func Write(path string, n int)

Write writes an integer counter to a file.

Parameters:

  • path: Absolute path to the counter file
  • n: Counter value to write

Types

This section is empty.

Jump to

Keyboard shortcuts

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