supervisor

package
v2.0.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package supervisor owns a PostgreSQL process independently of its Go caller.

Index

Constants

View Source
const Protocol = 1

Variables

This section is empty.

Functions

func Run

func Run(input io.Reader, output io.Writer) error

Run requires a dedicated pipe on input. EOF means the owner died or requested shutdown. The pipe is not inherited by PostgreSQL, so parent death closes it.

func RunCommand

func RunCommand(input io.Reader, output io.Writer) error

RunCommand supervises initdb and client utilities too. The caller cancels by closing its pipe. Only the child group created here is terminated on EOF.

Types

type Event

type Event struct {
	Protocol int    `json:"protocol"`
	PID      int    `json:"pid,omitempty"`
	Error    string `json:"error,omitempty"`
}

type Request

type Request struct {
	Protocol        int           `json:"protocol"`
	Binary          string        `json:"binary"`
	Args            []string      `json:"args"`
	DataDir         string        `json:"data_dir"`
	LogPath         string        `json:"log_path"`
	ShutdownTimeout time.Duration `json:"shutdown_timeout"`
}

Jump to

Keyboard shortcuts

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