watcher

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

internal/watcher/interface.go

internal/watcher/poller.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	RepoPath     string
	Time         time.Time
	StatusOutput []byte // Raw porcelain v2 output for reuse by the reader
}

type Poller

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

Poller monitors git repositories using polling instead of fsnotify. Uses git status to detect working tree changes.

func NewPoller

func NewPoller(interval time.Duration) *Poller

func (*Poller) Close

func (p *Poller) Close() error

func (*Poller) Events

func (p *Poller) Events() <-chan Event

func (*Poller) Run

func (p *Poller) Run(ctx context.Context)

func (*Poller) Unwatch

func (p *Poller) Unwatch(repoPath string)

func (*Poller) Watch

func (p *Poller) Watch(repoPath string) error

type RepoWatcher

type RepoWatcher interface {
	Events() <-chan Event
	Watch(repoPath string) error
	Unwatch(repoPath string)
	Run(ctx context.Context)
	Close() error
}

Jump to

Keyboard shortcuts

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