fileevents

package
v0.0.0-...-89905e9 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2016 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Version      string `json:"version"`
	Subscription string `json:"subscription"`
	Clock        string `json:"clock"`
	Files        []File `json:"files"`
	Root         string `json:"root"`
}

type EventContentChangeFilter

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

func NewEventContentChangeFilter

func NewEventContentChangeFilter(newHash func() hash.Hash) *EventContentChangeFilter

func (*EventContentChangeFilter) FilterContentChanges

func (e *EventContentChangeFilter) FilterContentChanges(incomingEvents chan *Event) chan *Event

func (*EventContentChangeFilter) SetDigest

func (e *EventContentChangeFilter) SetDigest(path string, digest tapjio.FileDigest)

type File

type File struct {
	Name   string `json:"name"`
	New    bool   `json:"new"`
	Exists bool   `json:"exists"`
}

type SubscribeConfirmEvent

type SubscribeConfirmEvent struct {
	Version   string `json:"version"`
	Subscribe string `json:"subscribe"`
}

type SubscribeRequestEvent

type SubscribeRequestEvent struct {
	Name   string
	Root   string
	Expr   interface{}
	Notify chan error
}

type Subscription

type Subscription struct {
	Events chan *Event
	// contains filtered or unexported fields
}

func (*Subscription) Close

func (s *Subscription) Close() error

func (*Subscription) Update

func (s *Subscription) Update(expr interface{}) error

type Watcher

type Watcher interface {
	Subscribe(root string, name string, expr interface{}) (*Subscription, error)
	Close() error
}

func StartWatchman

func StartWatchman(sockname string) (Watcher, error)

type WatchmanConn

type WatchmanConn struct {
	EventInbox             chan *Event
	SubscribeConfirmInbox  chan *SubscribeConfirmEvent
	SubscribeRequestOutbox chan *SubscribeRequestEvent
	Closer                 io.Closer
}

type WatchmanService

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

func (*WatchmanService) Close

func (w *WatchmanService) Close() error

func (*WatchmanService) Connect

func (w *WatchmanService) Connect() (*WatchmanConn, error)

func (*WatchmanService) Subscribe

func (w *WatchmanService) Subscribe(root string, name string, expr interface{}) (*Subscription, error)

Jump to

Keyboard shortcuts

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