watcher

package
v0.17.15 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package watcher provides file system monitoring for git ref changes.

It watches .git/refs/heads/ and .git/refs/stackit/ for modifications, debounces rapid changes, and notifies subscribers via a callback.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RefWatcher

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

RefWatcher watches git ref directories for changes and triggers callbacks.

func NewRefWatcher

func NewRefWatcher(repoRoot string, debounce time.Duration, onUpdate func()) *RefWatcher

NewRefWatcher creates a watcher that monitors git refs in the given repo. The onUpdate callback is called (debounced) when ref files change.

func (*RefWatcher) Start

func (w *RefWatcher) Start() error

Start begins watching git ref directories. It blocks, so call it in a goroutine.

func (*RefWatcher) Stop

func (w *RefWatcher) Stop()

Stop terminates the watcher.

Jump to

Keyboard shortcuts

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