watchman

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClientError = errors.New("watchman client error")
View Source
var FileChangeFields = []string{"name", "size", "mtime_us", "cclock"}

Functions

func WaitForReady

func WaitForReady(ctx context.Context, c Client) error

Types

type Client

type Client interface {
	Ping(ctx context.Context) error
	WatchSet(ctx context.Context, root string) error
	Recrawl(ctx context.Context, root string) error
	TriggerSet(ctx context.Context, root string, args any) error
	TriggerDel(ctx context.Context, root, name string) error
	ShutdownServer(ctx context.Context) error
}

Client is an abstract interface to a Watchman daemon.

type CommandClient

type CommandClient struct {
	Args []string
}

CommandClient implements access to a Watchman daemon through the "watchman" command line program.

func NewCommandClient

func NewCommandClient(base []string) *CommandClient

func (*CommandClient) Ping

func (c *CommandClient) Ping(ctx context.Context) error

func (*CommandClient) Recrawl

func (c *CommandClient) Recrawl(ctx context.Context, root string) error

func (*CommandClient) ShutdownServer

func (c *CommandClient) ShutdownServer(ctx context.Context) error

func (*CommandClient) TriggerDel

func (c *CommandClient) TriggerDel(ctx context.Context, root, name string) error

func (*CommandClient) TriggerSet

func (c *CommandClient) TriggerSet(ctx context.Context, root string, descriptor any) error

func (*CommandClient) WatchSet

func (c *CommandClient) WatchSet(ctx context.Context, root string) error

type FileChange

type FileChange struct {
	Name   string    `json:"name"`
	Size   int64     `json:"size"`
	MTime  time.Time `json:"-"`
	CClock string    `json:"cclock"`
}

func (FileChange) MarshalJSON

func (c FileChange) MarshalJSON() ([]byte, error)

func (*FileChange) UnmarshalJSON

func (c *FileChange) UnmarshalJSON(data []byte) error

type Flags

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

func (*Flags) Args

func (f *Flags) Args() []string

func (*Flags) NewClient

func (f *Flags) NewClient() *CommandClient

func (*Flags) SetFlags

func (f *Flags) SetFlags(fs *flag.FlagSet)

Jump to

Keyboard shortcuts

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