tombstone

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2020 License: Apache-2.0 Imports: 11 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, graveyard string, eventHandler EventHandler) error

Watch a graveyard and call the eventHandler (asyncronously) when an event happens. When the supplied context is canceled, watching will stop.

Types

type EventHandler

type EventHandler func(fsnotify.Event)

type Tombstone

type Tombstone struct {
	Born     *time.Time `json:",omitempty"`
	Died     *time.Time `json:",omitempty"`
	ExitCode *int       `json:",omitempty"`

	Graveyard string `json:"-"`
	Name      string `json:"-"`
	// contains filtered or unexported fields
}

func Read

func Read(graveyard, name string) (*Tombstone, error)

Read a tombstone from a graveyard.

func (*Tombstone) Path added in v0.2.0

func (t *Tombstone) Path() string

func (*Tombstone) RecordBirth added in v0.3.0

func (t *Tombstone) RecordBirth() error

func (*Tombstone) RecordDeath added in v0.3.0

func (t *Tombstone) RecordDeath(exitCode int) error

func (*Tombstone) String added in v0.2.0

func (t *Tombstone) String() string

func (*Tombstone) Write

func (t *Tombstone) Write() error

Write a tombstone file, truncating before writing. If the FilePath 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