executable

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseFile

func CloseFile(c io.Closer)

CloseFile closes file and panics if close fails.

func PerformSwitch

func PerformSwitch(src, dst string) error

PerformSwitch updates executable binary with new version from staging directory.

Types

type Executable

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

Executable is a structure representing an executable that may be updated.

func NewExecutable

func NewExecutable(path string, args ...string) (*Executable, error)

NewExecutable initializes an instance representing executable file.

func (Executable) GetChecksum

func (e Executable) GetChecksum() ([]byte, error)

GetChecksum computes checksum for executable binary.

func (Executable) GetModified

func (e Executable) GetModified() (time.Time, error)

GetModified retrieves file modification time from file system.

func (Executable) Latest

func (e Executable) Latest(dir string) (bool, error)

Latest checks whether Executable instance is running latest version of binary kept in staging directory.

func (Executable) Path

func (e Executable) Path() string

func (*Executable) Release

func (e *Executable) Release() error

func (*Executable) Start

func (e *Executable) Start(stdout io.Writer, stderr io.Writer) error

Start initializes and starts new subprocess

func (Executable) String

func (e Executable) String() string

String returns an executable name

func (Executable) Switch

func (e Executable) Switch(dir string) error

Switch overwrites executable for staging dir with exponential back-off

func (Executable) Terminate

func (e Executable) Terminate(tree bool) error

Terminate stops child process and waits for process exit

func (Executable) Wait

func (e Executable) Wait() (int, error)

Wait waits for child process exit and return exit code

Jump to

Keyboard shortcuts

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