watcherx

package
v0.0.155 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: Apache-2.0 Imports: 22 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSchemeUnknown = &errSchemeUnknown{}

ErrSchemeUnknown is just for checking with errors.Is()

Functions

func Watch

func Watch(ctx context.Context, u *url.URL, c EventChannel) error

func WatchAndServeWS added in v0.0.145

func WatchAndServeWS(ctx context.Context, u *url.URL, writer herodot.Writer) (http.HandlerFunc, error)

func WatchDirectory added in v0.0.142

func WatchDirectory(ctx context.Context, dir string, c EventChannel) error

func WatchFile

func WatchFile(ctx context.Context, file string, c EventChannel) error

func WatchWebsocket added in v0.0.145

func WatchWebsocket(ctx context.Context, u *url.URL, c EventChannel) error

Types

type ChangeEvent

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

func (*ChangeEvent) MarshalJSON added in v0.0.145

func (e *ChangeEvent) MarshalJSON() ([]byte, error)

func (*ChangeEvent) Reader

func (e *ChangeEvent) Reader() io.Reader

func (ChangeEvent) Source

func (e ChangeEvent) Source() string

type ErrorEvent

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

func (*ErrorEvent) MarshalJSON added in v0.0.145

func (e *ErrorEvent) MarshalJSON() ([]byte, error)

func (*ErrorEvent) Reader

func (e *ErrorEvent) Reader() io.Reader

func (ErrorEvent) Source

func (e ErrorEvent) Source() string

type Event

type Event interface {
	Reader() io.Reader
	Source() string
	// contains filtered or unexported methods
}

type EventChannel

type EventChannel chan Event

type RemoveEvent

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

func (*RemoveEvent) MarshalJSON added in v0.0.145

func (e *RemoveEvent) MarshalJSON() ([]byte, error)

func (*RemoveEvent) Reader

func (e *RemoveEvent) Reader() io.Reader

func (RemoveEvent) Source

func (e RemoveEvent) Source() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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