check

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: 9 Imported by: 0

Documentation

Overview

Package check provides shared preamble logic and throttling for hook input processing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DailyThrottled

func DailyThrottled(markerPath string) bool

DailyThrottled checks if a marker file was touched today (used to limit certain checks to once per day).

Parameters:

  • markerPath: Absolute path to the throttle marker file

Returns:

  • bool: True if the marker was touched today

func Preamble

func Preamble(stdin *os.File) (
	input entity.HookInput, sessionID string, paused bool,
)

Preamble reads hook input, resolves the session ID, and checks the pause state. Most hooks share this exact preamble sequence.

Parameters:

  • stdin: standard input for hook JSON

Returns:

  • input: parsed hook input
  • sessionID: resolved session identifier (falls back to config.IDSessionUnknown)
  • paused: true if the session is currently paused

func WrappedUpRecently

func WrappedUpRecently() bool

WrappedUpRecently checks whether the wrap-up marker exists and is less than the configured expiry old.

Returns true if nudges should be suppressed.

Returns:

  • bool: True if wrap-up marker is fresh

Types

This section is empty.

Jump to

Keyboard shortcuts

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