tombstone

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoggingEventHandler

func LoggingEventHandler(event fsnotify.Event)

LoggingEventHandler is an example EventHandler that logs fsnotify events

func Watch

func Watch(ctx context.Context, path string, eventHandler EventHandler) error

Watch a filesystem path and call the eventHandler (asyncronously) when an event happens. When the supplied context is canceled, watching will stop. If the path is a directory, events will also trigger for immediate children.

Types

type EventHandler

type EventHandler func(fsnotify.Event)

type Tombstone

type Tombstone struct {
	Born     *time.Time `json:",omitempty"`
	Died     *time.Time `json:",omitempty"`
	Ready    bool
	ExitCode *int `json:",omitempty"`
	// contains filtered or unexported fields
}

func Read

func Read(path string) (*Tombstone, error)

Read a tombstone file.

func (*Tombstone) Write

func (t *Tombstone) Write(path string) error

Write a tombstone file, truncating before writing. If the path directories do not exist, they will be created.

Jump to

Keyboard shortcuts

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