watchmanutil

package
v0.0.0-...-3a98d3a Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package watchmanutil provides utilities of watchman.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfo

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

func (FileInfo) IsDir

func (fi FileInfo) IsDir() bool

IsDir returns abbreviation for Mode().IsDir().

func (FileInfo) ModTime

func (fi FileInfo) ModTime() time.Time

ModTime returns modification time.

func (FileInfo) Mode

func (fi FileInfo) Mode() fs.FileMode

Mode returns file mode bits.

func (FileInfo) Name

func (fi FileInfo) Name() string

Name returns base name of the file.

func (FileInfo) Size

func (fi FileInfo) Size() int64

Size returns length in bytes.

func (FileInfo) Sys

func (fi FileInfo) Sys() any

Sys returns underlying data source (*pb.Entry).

type Watchman

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

Watchman interacts with watchman. https://facebook.github.io/watchman/

func New

func New(ctx context.Context, watchmanPath, dir string) (*Watchman, error)

New creates watchman for dir by watchman binary at watchmanPath. User needs to install `watchman` in PATH, and run `watchman watch-project $dir` before using it.

func (*Watchman) ClockToken

func (w *Watchman) ClockToken(ctx context.Context) (string, error)

ClockToken returns watchman clock.

func (*Watchman) Scan

func (w *Watchman) Scan(ctx context.Context, token string) (hashfs.FileInfoer, error)

Scan calls `watchman since` to finds all files that were modified since token.

type WatchmanScan

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

func (*WatchmanScan) FileInfo

func (ws *WatchmanScan) FileInfo(ctx context.Context, ent *pb.Entry) (fs.FileInfo, error)

FileInfo returns file info for the entry.

Jump to

Keyboard shortcuts

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