Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Detector ¶
type Detector int
Detector is used to specify how changes to the file should be detected.
const (
// DetectorInvalid indicates an invalid UpdateType.
DetectorInvalid Detector = iota
// DetectorFSNotify uses filesystem events to wait for changes to the file.
DetectorFSNotify
// DetectorPoll will re-read the file on an interval to detect changes.
DetectorPoll
// DetectorDefault holds the default UpdateType.
DetectorDefault = DetectorFSNotify
)
func (Detector) MarshalText ¶
func (ut Detector) MarshalText() (text []byte, err error)
MarshalText implements encoding.TextMarshaler.
func (Detector) String ¶
func (ut Detector) String() string
String returns the string representation of the UpdateType.
func (*Detector) UnmarshalText ¶
func (ut *Detector) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
type FSNotify ¶
type FSNotify struct {
// contains filtered or unexported fields
}
func NewFSNotify ¶
func NewFSNotify(opts FSNotifyOptions) (*FSNotify, error)
newFSNotify creates a new fsnotify detector which uses filesystem events to detect that a file has changed.
type FSNotifyOptions ¶
type FSNotifyOptions struct {
Logger log.Logger
Filename string
ReloadFile func() // Callback to request file reload.
PollFrequency time.Duration // How often to do fallback polling
}
type Poller ¶
type Poller struct {
// contains filtered or unexported fields
}
type PollerOptions ¶
type PollerOptions struct {
Filename string
ReloadFile func() // Callback to request file reload.
PollFrequency time.Duration
}
Click to show internal directories.
Click to hide internal directories.