hooks

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentHookVersion = 2

CurrentHookVersion is the latest hook script version. Increment this when the hook script changes in a breaking way.

View Source
const WarnIntervalSecs = 24 * 3600

WarnIntervalSecs is how often to warn about outdated hooks (24 hours).

Variables

This section is empty.

Functions

func MaybeWarn

func MaybeWarn()

MaybeWarn checks for outdated hooks using the default checker.

func ParseHookVersion

func ParseHookVersion(content string) uint8

ParseHookVersion extracts the version number from hook script content. Looks for "# tokman-hook-version: N" in the first 5 lines.

Types

type VersionChecker

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

VersionChecker handles hook version checking.

func NewVersionChecker

func NewVersionChecker() *VersionChecker

NewVersionChecker creates a new version checker.

func (*VersionChecker) MaybeWarn

func (v *VersionChecker) MaybeWarn()

MaybeWarn checks if the installed hook is outdated and warns once per day. This is non-blocking and fails silently on errors.

Jump to

Keyboard shortcuts

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