Documentation
¶
Index ¶
- Variables
- type CommandRunner
- type EnvGetter
- type FileOpener
- type ListenerOptions
- type Options
- type ProcessFinder
- type State
- type ZeroDownTime
- func (z *ZeroDownTime) Close(ctx context.Context) error
- func (z *ZeroDownTime) GetPID() (int, error)
- func (z *ZeroDownTime) IsUpgraded() bool
- func (z *ZeroDownTime) Listener(ctx context.Context, options *ListenerOptions) (net.Listener, error)
- func (z *ZeroDownTime) Quit(ctx context.Context, pid int, removePIDFile bool) error
- func (z *ZeroDownTime) RemoveUpgradeSock() error
- func (z *ZeroDownTime) Upgrade() error
- func (z *ZeroDownTime) WaitForUpgrade(ctx context.Context) error
- func (z *ZeroDownTime) WritePID() error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrKillTimeout = errors.New("process did not terminate within the timeout period")
)
Functions ¶
This section is empty.
Types ¶
type CommandRunner ¶ added in v0.3.0
type ListenerOptions ¶ added in v0.5.0
type ListenerOptions struct { Config *net.ListenConfig Network string Address string ProxyProtocol bool }
type ProcessFinder ¶ added in v0.3.0
type ZeroDownTime ¶
func New ¶
func New(opts Options) *ZeroDownTime
func (*ZeroDownTime) GetPID ¶ added in v0.2.0
func (z *ZeroDownTime) GetPID() (int, error)
func (*ZeroDownTime) IsUpgraded ¶
func (z *ZeroDownTime) IsUpgraded() bool
func (*ZeroDownTime) Listener ¶
func (z *ZeroDownTime) Listener(ctx context.Context, options *ListenerOptions) (net.Listener, error)
func (*ZeroDownTime) Quit ¶ added in v0.4.0
Quit sends a signal to the process and waits for it to exit. If the process does not exit within the timeout period, it will be sent a SIGKILL signal. If removePIDFile is true, the PID file will be removed if it exists.
The signal sent is SIGHUP, which is usually used to restart a process. If the process has already exited, this method will return nil immediately.
If the process does not exit within the timeout period, ErrKillTimeout will be returned.
func (*ZeroDownTime) RemoveUpgradeSock ¶ added in v0.2.0
func (z *ZeroDownTime) RemoveUpgradeSock() error
func (*ZeroDownTime) Upgrade ¶
func (z *ZeroDownTime) Upgrade() error
func (*ZeroDownTime) WaitForUpgrade ¶
func (z *ZeroDownTime) WaitForUpgrade(ctx context.Context) error
func (*ZeroDownTime) WritePID ¶ added in v0.2.0
func (z *ZeroDownTime) WritePID() error
Click to show internal directories.
Click to hide internal directories.