Documentation ¶
Index ¶
- Constants
- Variables
- type CaseSensitivity
- type Client
- func (c *Client) Clock(root string) (string, error)
- func (c *Client) Close() error
- func (c *Client) Connect(addr string) error
- func (c *Client) Find(dir string, patterns ...string) ([]File, string, error)
- func (c *Client) GetConfig(dir string) (*Config, error)
- func (c *Client) GetSockname() (string, error)
- func (c *Client) ListCapabilities() ([]string, error)
- func (c *Client) Log(level, msg string) (bool, error)
- func (c *Client) LogLevel(level string) error
- func (c *Client) Query(dir string, conf QueryOptions) ([]File, string, error)
- func (c *Client) ShutdownServer() (bool, error)
- func (c *Client) Since(dir string, clock string, patterns ...string) ([]File, string, error)
- func (c *Client) Subscribe(root, name string, opts *SubscriptionOptions) error
- func (c *Client) Trigger(root string, opts *TriggerOptions) error
- func (c *Client) TriggerDel(root, name string) error
- func (c *Client) TriggerList(root string) ([]string, error)
- func (c *Client) Unsubscribe(root, name string) error
- func (c *Client) Version() (string, error)
- func (c *Client) Watch(dir string) error
- func (c *Client) WatchDel(dir string) error
- func (c *Client) WatchDelAll() error
- func (c *Client) WatchList() ([]string, error)
- func (c *Client) WatchProject(dir string) error
- type Config
- type Expression
- func AllOf(expr ...Expression) Expression
- func AnyOf(expr ...Expression) Expression
- func Dirname(cs CaseSensitivity, dir string) Expression
- func Empty() Expression
- func Exists() Expression
- func Match(cs CaseSensitivity, scope ExpressionScope, pattern string) Expression
- func Name(cs CaseSensitivity, scope ExpressionScope, names ...string) Expression
- func Not(expr Expression) Expression
- func Pcre(cs CaseSensitivity, scope ExpressionScope, pattern string) Expression
- func SinceClock(clock string) Expression
- func SinceTime(t time.Time, tf string) Expression
- func Size() Expression
- func Suffix(suffix string) Expression
- func Type(typ string) Expression
- type ExpressionScope
- type File
- type Path
- type QueryOptions
- type StdinArray
- type StdinType
- type SubscriptionEvent
- type SubscriptionOptions
- type TriggerOptions
Constants ¶
const ( TimeFieldModified = "mtime" TimeFieldCreated = "ctime" )
const ( TypeBlockSpecialFile = "b" TypeCharacterSpecialFile = "c" TypeDirectory = "d" TypeRegularFile = "f" TypeNamedPipe = "p" TypeSymbolicLink = "l" TypeSocket = "s" TypeSolarisDoor = "D" )
Variables ¶
var ( Wholename = ExpressionScope{"wholename"} Basename = ExpressionScope{"basename"} CaseSensitive = CaseSensitivity{true} CaseInsensitive = CaseSensitivity{false} )
Functions ¶
This section is empty.
Types ¶
type CaseSensitivity ¶
type CaseSensitivity struct {
// contains filtered or unexported fields
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client manages a single socket connection to the watchman server. Connect must be called before any other method is used.
func NewClient ¶
NewClient returns a new Client. Connect must be called before any other client methods are used. An optional logHandler may be passed in to handle an watchman generated log messages.
func (*Client) Clock ¶
Clock returns the watchman server clock time at the specified root for more info, see https://facebook.github.io/watchman/docs/cmd/clock.html
func (*Client) Connect ¶
Connect initializes the connection the watchman server. It assumes that watchman server is running locally and attempts a unix socket connection addr is the path to the watchman server socket location. If an empty string is provided, Client will attempty to infer the location from the env var WATCHMAN_SOCK and, if that fails, by shelling out a `watchman get-sockname` call
func (*Client) ListCapabilities ¶
https://facebook.github.io/watchman/docs/cmd/list-capabilities.html
func (*Client) Subscribe ¶
func (c *Client) Subscribe(root, name string, opts *SubscriptionOptions) error
type Config ¶
type Config struct { Settle int `json:"settle"` RootRestrictFiles []string `json:"root_restrict_files"` RootFiles [][]string `json:"root_files"` EnforceRootFiles bool `json:"enforce_root_files"` IllegalFSTypes []string `json:"illegal_fstypes"` IllegalFSTypesAdvice string `json:"illegal_fstypes_advice"` IgnoreVCS []string `json:"ignore_vcs"` IgnoreDirs []string `json:"ignore_dirs"` GCAgeSeconds int `json:"gc_age_seconds"` GCIntervalSeconds int `json:"gc_interval_seconds"` FSEventsLatency float64 `json:"fsevents_latency"` IdleReapAgeSeconds int `json:"idle_reap_age_seconds"` }
type Expression ¶
type Expression interface {
// contains filtered or unexported methods
}
func AllOf ¶
func AllOf(expr ...Expression) Expression
func AnyOf ¶
func AnyOf(expr ...Expression) Expression
func Dirname ¶
func Dirname(cs CaseSensitivity, dir string) Expression
func Match ¶
func Match(cs CaseSensitivity, scope ExpressionScope, pattern string) Expression
func Name ¶
func Name(cs CaseSensitivity, scope ExpressionScope, names ...string) Expression
func Not ¶
func Not(expr Expression) Expression
func Pcre ¶
func Pcre(cs CaseSensitivity, scope ExpressionScope, pattern string) Expression
func SinceClock ¶
func SinceClock(clock string) Expression
func Suffix ¶
func Suffix(suffix string) Expression
func Type ¶
func Type(typ string) Expression
type ExpressionScope ¶
type ExpressionScope struct {
// contains filtered or unexported fields
}
type QueryOptions ¶
type QueryOptions struct { Suffix []string `json:"suffix,omitempty"` Since string `json:"since,omitempty"` Expression Expression `json:"expression,omitempty"` Fields []string `json:"fields,omitempty"` Path []Path `json:"path,omitempty"` SyncTimeout int `json:"sync_timeout,omitempty"` EmptyOnFreshInstance bool `json:"empty_on_fresh_instance,omitempty"` RelativeRoot string `json:"relative_root,omitempty"` }
type StdinArray ¶
type StdinArray []string
type SubscriptionEvent ¶
type SubscriptionOptions ¶
type SubscriptionOptions struct { Since string Expr Expression Fields []string DeferVCS bool }
type TriggerOptions ¶
type TriggerOptions struct { Name string `json:"name"` Command []string `json:"command"` AppendFiles bool `json:"append_files,omitempty"` Expression interface{} `json:"expression"` Stdin StdinType `json:"stdin"` Stdout string `json:"stdout"` Stderr string `json:"stderr"` MaxFilesStdin int `json:"max_files_stdin"` Chdir string `json:"chdir"` RelativeRoot string `json:"relative_root"` }