reloader

package
v0.0.0-...-307e663 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetExecutable

func SetExecutable(name string) error

SetExecutable sets executable bit for a file in tmp directory.

Types

type Config

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

func (*Config) SetChild

func (c *Config) SetChild(child string, args ...string)

SetChild configures child cmd and arguments.

func (*Config) SetInterval

func (c *Config) SetInterval(interval time.Duration)

SetInterval configures update check interval.

func (*Config) SetLogger

func (c *Config) SetLogger(logger *log.Logger)

SetLogger configures reloader logger.

func (*Config) SetRestart

func (c *Config) SetRestart(restart bool)

SetRestart configures child automatic restarts.

func (*Config) SetStaging

func (c *Config) SetStaging(staging string) error

SetStaging configures updates directory path.

func (*Config) SetStderr

func (c *Config) SetStderr(s io.Writer)

SetStderr configures child process stderr redirection.

func (*Config) SetStdout

func (c *Config) SetStdout(s io.Writer)

SetStdout configures child process stdout redirection.

func (*Config) SetTerminateTree

func (c *Config) SetTerminateTree(tree bool)

SetTerminateTree configures terminate process tree flag.

type Reloader

type Reloader struct {
	Config
	// contains filtered or unexported fields
}

Reloader watches, updates and restarts an executable.

func NewReloader

func NewReloader(version string) *Reloader

NewReloader returns a new Reloader instance with default configuration.

func (*Reloader) Daemonize

func (r *Reloader) Daemonize() error

Daemonize detaches console application from terminal, making reloader a daemon.

func (Reloader) RestartDaemon

func (r Reloader) RestartDaemon(name string) error

func (*Reloader) Run

func (r *Reloader) Run() error

func (*Reloader) Update

func (r *Reloader) Update(what string, restart bool) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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