Documentation ¶
Overview ¶
+build linux
Index ¶
Constants ¶
const DefaultPolling = 5 * time.Second
DefaultPolling for Run when RunConf.Polling is set to the zero time.Duration
Variables ¶
This section is empty.
Functions ¶
func AddTarget ¶
AddTarget loads the config from the default path, adds the new target, and saves the new config file
Types ¶
type Config ¶
Config is a set of targets
func LoadConfig ¶
LoadConfig loads the config from the default path
type RunConf ¶
type RunConf struct { Args []string HotReload bool OnSuccess RunReaction OnFailure RunReaction Polling time.Duration }
RunConf is the Runner's configuration
type RunEvent ¶
type RunEvent struct { Type RunEventType Version types.Version ExitCode int Reason string }
RunEvent is an event generated by the Runner Version is only valid for AppStarted events ExitCode is only valid for Stopped events
type RunEventType ¶
type RunEventType int
RunEventType is the type of events generated by Runner
const ( // AppStarted events are sent when the application process gets started AppStarted RunEventType = iota // AppExit events are sent when the application process ends without being interrupted/killed for hotreloading updates AppExit // Stopped events are sent when the runner ends its execution, this is controlled by the OnSuccess/OnFailure properties of RunConf Stopped )
type RunReaction ¶
type RunReaction int
RunReaction is the action to take when the deployed application exits
const ( // Exit will stop the Runner's goroutine, returning "Stopped" to WaitForEvent() Exit RunReaction = iota // Wait will wait for future update (deploys), which will be started Wait // Restart will restart the application inmediatly Restart )
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner manages the download, execution and updating process of a deployed application
func (*Runner) Stop ¶
func (r *Runner) Stop()
Stop stops the current runner, interrupting/killing the application
func (*Runner) WaitForEvent ¶
WaitForEvent waits for the generation of the next RunEvent