watch

package
v0.0.0-...-646a99c Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxFileSize = 20000000

MaxFileSize to open

Functions

func BackOffFileCheck

func BackOffFileCheck(file string) bool

BackOffFileCheck --

func FileExist

func FileExist(file string) bool

FileExist -- general file checker

Types

type CMD

type CMD struct {
	CmdWrite     func(string)
	CmdAllEvents func(string)
	TickCmd      func(string)
	File         string

	sync.Mutex
	// contains filtered or unexported fields
}

CMD -- format for config

func OpenWatcher

func OpenWatcher(cmdWrite func(string),
	cmdAllEvents func(string),
	tickcmd func(string), file string) *CMD

OpenWatcher --

func (*CMD) RestartCount

func (cmd *CMD) RestartCount() int64

RestartCount --

func (*CMD) Stop

func (cmd *CMD) Stop()

Stop --

func (*CMD) Watcher

func (cmd *CMD) Watcher()

Watcher --

type EventMap

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

EventMap --

type MC

type MC struct {
	sync.Mutex

	Slave WatchFuncExec
	// contains filtered or unexported fields
}

MC --

func NewMC

func NewMC(file string, slave WatchFuncExec) *MC

NewMC --

func (*MC) AddEvent

func (m *MC) AddEvent(e string)

AddEvent --

func (*MC) AllEvents

func (m *MC) AllEvents(event string)

AllEvents --

func (*MC) Count

func (m *MC) Count() int

Count --

func (*MC) File

func (m *MC) File() string

File --

func (*MC) FireSlaveTickEvent

func (m *MC) FireSlaveTickEvent(event string)

func (*MC) FireSlaveWriteEvent

func (m *MC) FireSlaveWriteEvent(event string)

func (*MC) GetB

func (m *MC) GetB() []byte

GetB --

func (*MC) GetTick

func (m *MC) GetTick() time.Time

func (*MC) Inc

func (m *MC) Inc() int

Inc --

func (*MC) LastEvent

func (m *MC) LastEvent() (EventMap, error)

func (*MC) Read

func (m *MC) Read()

Read --

func (*MC) RemoveRename

func (m *MC) RemoveRename(event string)

RemoveRename --

func (*MC) ResetRemoveRename

func (m *MC) ResetRemoveRename()

ResetRemoveRename --

func (*MC) SetFile

func (m *MC) SetFile(file string)

SetFile --

func (*MC) StatusRemoveRename

func (m *MC) StatusRemoveRename() bool

StatusRemoveRename --

func (*MC) Tick

func (m *MC) Tick(event string)

Tick --

func (*MC) TickUpdate

func (m *MC) TickUpdate()

Count --

func (*MC) WriteEvent

func (m *MC) WriteEvent(event string)

WriteEvent -- hold no locks on this one

type MCError

type MCError struct {
	When time.Time
	What string
}

MCError --

func (MCError) Error

func (e MCError) Error() string

type WatchFuncExec

type WatchFuncExec interface {
	WriteEvent(event string)
	AllEvents(event string)
	Tick(event string)
}

Jump to

Keyboard shortcuts

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