zero

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

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 CommandRunner interface {
	Command(name string, arg ...string) *exec.Cmd
}

type EnvGetter added in v0.3.0

type EnvGetter func(string) string

type FileOpener added in v0.3.0

type FileOpener func(name string) (*os.File, error)

type Options

type Options struct {
	UpgradeSock string
	PIDFile     string
	KillTimout  time.Duration
}

func (Options) GetPIDFile

func (opts Options) GetPIDFile() string

func (Options) GetUpgradeSock

func (opts Options) GetUpgradeSock() string

type ProcessFinder added in v0.3.0

type ProcessFinder interface {
	FindProcess(pid int) (process, error)
}

type State

type State int8

type ZeroDownTime

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

func New

func New(opts Options) *ZeroDownTime

func (*ZeroDownTime) Close

func (z *ZeroDownTime) Close(ctx context.Context) error

func (*ZeroDownTime) GetPID added in v0.2.0

func (z *ZeroDownTime) GetPID() (int, error)

func (*ZeroDownTime) IsUpgraded

func (z *ZeroDownTime) IsUpgraded() bool

func (*ZeroDownTime) KillProcess added in v0.2.0

func (z *ZeroDownTime) KillProcess(ctx context.Context, pid int, removePIDFile bool) error

func (*ZeroDownTime) Listener

func (z *ZeroDownTime) Listener(ctx context.Context, network string, address string, cfg *net.ListenConfig) (net.Listener, error)

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

Jump to

Keyboard shortcuts

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