Package watcherx
- Variables
- func WatchAndServeWS(ctx context.Context, u *url.URL, writer herodot.Writer) (http.HandlerFunc, error)
- type ChangeEvent
- func (e *ChangeEvent) MarshalJSON() ([]byte, error)
- func (e *ChangeEvent) Reader() io.Reader
- func (e ChangeEvent) Source() string
- func (e *ChangeEvent) String() string
- type ErrorEvent
- func (e *ErrorEvent) MarshalJSON() ([]byte, error)
- func (e *ErrorEvent) Reader() io.Reader
- func (e ErrorEvent) Source() string
- func (e *ErrorEvent) String() string
- type Event
- type EventChannel
- type RemoveEvent
- func (e *RemoveEvent) MarshalJSON() ([]byte, error)
- func (e *RemoveEvent) Reader() io.Reader
- func (e RemoveEvent) Source() string
- func (e *RemoveEvent) String() string
- type Watcher
- func Watch(ctx context.Context, u *url.URL, c EventChannel) (Watcher, error)
- func WatchDirectory(ctx context.Context, dir string, c EventChannel) (Watcher, error)
- func WatchFile(ctx context.Context, file string, c EventChannel) (Watcher, error)
- func WatchWebsocket(ctx context.Context, u *url.URL, c EventChannel) (Watcher, error)
Package files
definitions.go
directory.go
event.go
file.go
test_helpers.go
websocket_client.go
websocket_server.go
Variables
var (
ErrSchemeUnknown = &errSchemeUnknown{}
ErrWatcherNotRunning = fmt.Errorf("watcher is not running")
)
func WatchAndServeWS(ctx context.Context, u *url.URL, writer herodot.Writer) (http.HandlerFunc, error)
type ChangeEvent struct {
}
func (e *ChangeEvent) MarshalJSON() ([]byte, error)
func (*ChangeEvent) Reader
¶
func (e *ChangeEvent) Reader() io.Reader
func (ChangeEvent) Source
¶
func (e ChangeEvent) Source() string
func (*ChangeEvent) String
¶
func (e *ChangeEvent) String() string
type ErrorEvent struct {
}
func (e *ErrorEvent) MarshalJSON() ([]byte, error)
func (*ErrorEvent) Reader
¶
func (e *ErrorEvent) Reader() io.Reader
func (ErrorEvent) Source
¶
func (e ErrorEvent) Source() string
func (*ErrorEvent) String
¶
func (e *ErrorEvent) String() string
type Event interface {
json.Marshaler
Reader() io.Reader
Source() string
String() string
}
type EventChannel chan Event
type RemoveEvent struct {
}
func (e *RemoveEvent) MarshalJSON() ([]byte, error)
func (*RemoveEvent) Reader
¶
func (e *RemoveEvent) Reader() io.Reader
func (RemoveEvent) Source
¶
func (e RemoveEvent) Source() string
func (*RemoveEvent) String
¶
func (e *RemoveEvent) String() string
type Watcher interface {
DispatchNow() (<-chan int, error)
}
func Watch(ctx context.Context, u *url.URL, c EventChannel) (Watcher, error)
func WatchDirectory(ctx context.Context, dir string, c EventChannel) (Watcher, error)
func WatchFile(ctx context.Context, file string, c EventChannel) (Watcher, error)
func WatchWebsocket(ctx context.Context, u *url.URL, c EventChannel) (Watcher, error)
Subdirectories